-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (71 loc) · 2.04 KB
/
palletjack.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Palletjack - Deploy to Cloud Run Job
on:
push:
paths:
- 'src/palletjack/**'
- '.github/workflows/palletjack.yml'
- '.github/actions/palletjack/deploy/action.yml'
concurrency:
group: '${{ github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
working-directory: src/palletjack
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: ⬇️ Set up code
uses: actions/checkout@v4
- name: 📥 Download extra dependencies
run: |
sudo apt-get update
sudo apt-get install -y libkrb5-dev
- name: 🏗 Install module
run: pip install .[tests]
- name: 🧪 Run tests
run: pytest
deploy-dev:
name: Deploy Staging to GCF
runs-on: ubuntu-latest
needs: test
if: github.ref_name == 'staging'
environment:
name: Staging
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
- name: 🚀 Deploy
uses: ./.github/actions/palletjack/deploy
with:
project_id: ${{ secrets.PROJECT_ID }}
identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
pause_schedule_job: 'yes'
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy-prod:
name: Deploy Production to GCF
runs-on: ubuntu-latest
needs: test
if: github.ref_name == 'production'
environment:
name: Production
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
- name: 🚀 Deploy
uses: ./.github/actions/palletjack/deploy
with:
project_id: ${{ secrets.PROJECT_ID }}
identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
github_token: ${{ secrets.GITHUB_TOKEN }}