Skip to content

Publish

Publish #424

Workflow file for this run

name: Publish
defaults:
run:
shell: bash # Every steps will have a /usr/bin/bash --noprofile --norc -e -o pipefail
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
permissions:
actions: write
contents: read
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: prod
url: https://docs.gatling.io
timeout-minutes: 10
steps:
- name: Checkout current project
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.135.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Generate site
run: ./bin/entrypoint.sh generate
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-3
role-to-assume: ${{ secrets.AWS_ROLE_PROD_DOC }}
- name: Deploy
run: |
sed -i 's/HUGO_DEPLOYMENT_BUCKET/${{ secrets.HUGO_DEPLOYMENT_BUCKET }}/' config/production/config.yaml
sed -i 's/HUGO_DEPLOYMENT_CLOUDFRONT_DISTRIBUTION_ID/${{ secrets.HUGO_DEPLOYMENT_CLOUDFRONT_DISTRIBUTION_ID }}/' config/production/config.yaml
hugo deploy --maxDeletes -1 --invalidateCDN