-
Notifications
You must be signed in to change notification settings - Fork 11
67 lines (53 loc) · 1.78 KB
/
docs-upload-gcp-prod.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
56
57
58
59
60
61
62
63
64
65
66
67
name: Upload production docs to GCP
on:
push:
branches:
- main
concurrency:
# yamllint disable-line rule:line-length
group: "${{ github.workflow }} @ ${{ github.ref }}"
cancel-in-progress: true
jobs:
docs-upload-to-gcp-prod:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4.0.0
with:
persist-credentials: false
- name: Setup Node 🔧
uses: actions/setup-node@v3
with:
node-version: 18
- name: Deployment start
if: always()
uses: Mergifyio/gha-slack-notification@main
with:
type: deploy-start
project: "documentation (gatsby)"
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOYMENT_WEBHOOK_URL_RELEASES }}
- name: Build 🔧
run: |
npm ci
npm run build
- name: Setup Google Auth 🔧
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_DOCS_CREDENTIAL_JSON }}"
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Deploy 🚀
run: 'gsutil -m rsync -r ./public gs://mergify-docs-prod'
- name: Cleanup
run: 'gsutil -m rsync -d -r ./public gs://mergify-docs-prod'
- name: Set header
run: 'gsutil -m setmeta -r -h "Cache-control:public, max-age=600" gs://mergify-docs-prod'
- name: Deployment finish
if: always()
uses: Mergifyio/gha-slack-notification@main
with:
type: deploy-finish
project: "documentation (gatsby)"
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOYMENT_WEBHOOK_URL_RELEASES }}
FAILURE_ONLY_SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOYMENT_WEBHOOK_URL_PROD }}