Skip to content

Deploy site

Deploy site #1300

Workflow file for this run

name: Deploy site
on:
push:
branches:
- develop
schedule:
- cron: "5 1 * * *"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: 20
- name: Dump dynamic files
run: ./dump_napituti.sh
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
PEXELS_API_KEY: ${{ secrets.PEXELS_API_KEY }}
- name: Setup AWS cli
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Upload to S3
run: aws s3 sync . s3://napipatrik --delete --exclude ".git/*"
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Publish to social media
if: github.event_name == 'schedule'
run: ./publish_napituti.sh
env:
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4