-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (48 loc) · 1.36 KB
/
cicd.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
---
name: tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
types: [opened, reopened, synchronize]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install jshint
run: npm install -g jshint
- name: Run Tests
run: jshint includes/ --verbose
deploy:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Set GCS Bucket Name (Staging)
if: endsWith(github.ref, '/develop')
run: |
echo 'GCS_BUCKET_NAME=canvas-static-test' >> $GITHUB_ENV
- name: Set GCS Bucket Name (Production)
if: endsWith(github.ref, '/main')
run: |
echo 'GCS_BUCKET_NAME=canvas-static' >> $GITHUB_ENV
- name: Sync Files to GCS
uses: uw-it-aca/actions/sync-gcs@main
with:
source_dir: includes
bucket_name: ${GCS_BUCKET_NAME}