-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.37 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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