-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.25 KB
/
deploy_backup.yaml
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
on: # [pull_request]
push:
branches:
- main
name: Deploy Backup
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.92.1'
- name: Build
run: hugo --destination dist/ --minify --config=backup_config.toml
- name: Upload built blog
uses: actions/upload-artifact@v3
with:
name: website
path: dist/
retention-days: 1
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_CREDENTIALS }}'
# Setup gcloud CLI
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Download built artifact
uses: actions/download-artifact@v3
with:
name: website
path: dist/
- name: Delete website
run: gsutil -m rm -a gs://verygoodsoftwarenotvirus.blog/**
- name: Deploy website
run: gsutil -m cp -r dist/* gs://verygoodsoftwarenotvirus.blog/