-
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.64 KB
/
build.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Build"
on:
workflow_dispatch:
schedule:
- cron: '5 4 1,15 * *' # At 04:05 on day-of-month 1 and 15.
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
website:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Website
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get install \
libjson-xs-perl \
libtemplate-perl \
libplack-perl \
jq
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v4
# Configure Workload Identity Federation via a credentials file.
- id: auth
name: 🔐 Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/147435552396/locations/global/workloadIdentityPools/github-com/providers/github-com-oidc'
service_account: '[email protected]'
export_environment_variables: true
# Install gcloud, `setup-gcloud` automatically picks up authentication from `auth`.
# https://github.com/marketplace/actions/set-up-gcloud-cloud-sdk-environment
- name: '🔧 Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
# Now you can run gcloud commands authenticated as the impersonated service account.
- name: Get roles
run: |
cd build || exit 9
bash roles.sh || exit 9
- name: Get permissions
run: |
cd build || exit 9
bash permissions.sh || exit 9
- name: Commit IAM changes
run: |
cd build || exit 9
bash commit.sh || exit 9
- name: Build web pages
run: |
cd build || exit 9
perl build.pl || exit 9
- name: Setup Pages
uses: actions/configure-pages@v3
# https://github.com/marketplace/actions/upload-github-pages-artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'page/'
# https://github.com/marketplace/actions/deploy-github-pages-site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2