-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (49 loc) · 1.68 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
SUBSTITUTIONS: "
_PROJECT=${{ secrets.GCP_PROJECT_ID }},\
_REGION=us-central1,\
_PIPELINE_NAME=sentiment-analysis-tfx,\
_REPO_URL=https://github.com/arturlunardi/sentiment-analysis-tfx,\
_BRANCH=master,\
"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: auth
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: check if something changed
uses: dorny/paths-filter@v2.2.1
id: filter
with:
base: 'master'
filters: |
pipeline:
- 'tfx-pipeline/**'
modules:
- 'modules/**'
- name: trigger cloud build based on pipeline changes
if: ${{ steps.filter.outputs.pipeline == 'true' }}
run: |
gcloud builds submit --no-source --timeout=60m \
--config build/full-pipeline-deployment.yaml \
--substitutions $SUBSTITUTIONS \
--machine-type=n1-highcpu-8
- name: trigger cloud build based on modules changes
if: ${{ steps.filter.outputs.modules == 'true' && steps.filter.outputs.pipeline == 'false' }}
run: |
gcloud builds submit --no-source --timeout=60m \
--config build/partial-pipeline-deployment.yaml \
--substitutions $SUBSTITUTIONS \
--machine-type=n1-highcpu-8