-
Notifications
You must be signed in to change notification settings - Fork 156
66 lines (58 loc) · 1.73 KB
/
deploy.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: Deploy Hugo to S3
on:
workflow_call:
inputs:
target:
description: "Hugo target to deploy to"
required: true
type: string
aws-region:
description: "AWS Region to use for fetching credentials"
required: false
type: string
default: "us-west-2"
secrets:
AWS_OIDC_ROLE:
required: true
HUGO_LLM_API:
required: true
env:
HUGO_VERSION: 0.130.0
jobs:
build_and_deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo Themes
fetch-depth: 0
# Sets Up Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
# Installs Post-CSS
- name: Install Post-CSS
run: npm install postcss-cli
- name: AWS Github OIDC Login
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
aws-region: ${{ inputs.aws-region }}
# Builds arm-software-developer repo
- name: Build
run: |
hugo --minify
cp learn-image-sitemap.xml public/learn-image-sitemap.xml
bin/pagefind --site "public"
env:
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
# Deploys website to AWS S3 and invalidate CloudFront Cache
- name: Deploy to S3
run: hugo deploy --force --maxDeletes -1 --invalidateCDN --target ${{ inputs.target }}