-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.01 KB
/
github-actions.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
name: Build & Deploy
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_BUCKET: ${{ secrets.GCP_BUCKET }}
on:
push:
branches:
- 'main'
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Get Zola'
run: wget "https://github.com/getzola/zola/releases/download/v0.17.2/zola-v0.17.2-x86_64-unknown-linux-gnu.tar.gz"
- name: 'Extract zola'
run: tar xzf zola-v0.17.2-x86_64-unknown-linux-gnu.tar.gz
- name: 'Build site'
run: ./zola build
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@v2
- name: 'Deploy'
run: 'gsutil -h "Cache-Control:no-store" -m cp -r public/* gs://${GCP_BUCKET}'