forked from ArmDeveloperEcosystem/arm-learning-paths
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.33 KB
/
deploy.yml
File metadata and controls
81 lines (72 loc) · 2.33 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
HUGO_RAG_API:
required: true
HUGO_AUDIO_API:
required: true
HUGO_PHI_ONNX_LLM_API:
required: true
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID:
required: true
HUGO_FORM_ID_FOR_PROGRAM_SIGNUP:
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-24.04-arm
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
- name: Clear npm cache
run: npm cache clean --force
# 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
env:
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }}
HUGO_AUDIO_API: ${{ secrets.HUGO_AUDIO_API }}
HUGO_PHI_ONNX_LLM_API: ${{ secrets.HUGO_PHI_ONNX_LLM_API }}
HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID: ${{ secrets.HUGO_DEV_PROG_SIGNIUP_FORM_MUNCHKIN_ID }}
HUGO_FORM_ID_FOR_PROGRAM_SIGNUP: ${{ secrets.HUGO_FORM_ID_FOR_PROGRAM_SIGNUP }}
# Deploys website to AWS S3 and invalidate CloudFront Cache
- name: Deploy to S3
run: hugo deploy --force --maxDeletes -1 --invalidateCDN --target ${{ inputs.target }}