-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.26 KB
/
ci.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
name: Build and Upload
on:
push:
branches: ['main']
jobs:
build_and_upload:
runs-on: ubuntu-latest
name: Build dotfiles tarball
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
- name: Build tar file
run: |
set -ex
rm -rf dist && mkdir dist
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
python3 etc/build.py --no-upload --branch "$branch" --copy-to dist
- name: Final artifact summary
run: |
set -e
(
echo '## Artifact files'
echo '```sh'
ls -lh dist
echo '```'
) >> "$GITHUB_STEP_SUMMARY"
- name: "Authenticate to google cloud"
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.SERVICE_ACCOUNT }}
- name: 'Upload to public bucket'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: dist
parent: false
gzip: yes
destination: 'nmk.nuimk.com'
process_gcloudignore: false