-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (52 loc) · 1.5 KB
/
hugo.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
56
57
58
59
60
61
62
63
64
65
66
name: Hugo
on:
push:
branches:
- main
pull_request:
env:
HUGO_ENV: production
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.122.0'
extended: true
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ugns-gbl-github-actions
role-session-name: ugns-github-actions
aws-region: us-east-1
- name: Assume IAM Role
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::072105303426:role/GitHubActionsExecution
role-skip-session-tagging: true
role-chaining: true
aws-region: us-east-1
- name: Hugo Build
run: hugo --gc --enableGitInfo --minify
- name: Hugo Deploy (dry-run)
if: github.event_name == 'pull_request'
run: hugo deploy --dryRun --target AWS
- name: Hugo Deploy
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: hugo deploy --target AWS