-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 1.78 KB
/
build-analyzer.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
68
69
70
71
72
73
name: Build Analyzer
on:
push:
branches: [ "main" ]
paths:
- "applications/data_analyzer/**"
concurrency:
group: build-group
cancel-in-progress: false
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GAR_LOCATION: us-central1
jobs:
setup-build-publish:
name: Setup, Build, Publish
runs-on: ubuntu-latest
environment: production
permissions:
contents: 'write'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Set up Taskfile
uses: arduino/[email protected]
- name: Run Lint Check
run: task lint-check
# - name: Run all tests
# run: task test
# Authentication to GCP via credentials json
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Docker configuration
run: gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev --quiet
- name: Build
run: task build-analyzer-image tag="$GITHUB_SHA"
# Push the Docker image to Google Artifact Registry
- name: Publish
run: task push-analyzer-image tag="$GITHUB_SHA"
- name: Replace analyzer Image Tag
run: sed -i "s/\(&analyzerImageTag\) [^[:space:]]*/\1 $GITHUB_SHA/g" infrastructure/k8s/folio-feed-helm/values.yaml
- name: Commit the Changes
run: |
git config user.name "Github Actions"
git config user.email [email protected]
git diff
git add infrastructure/k8s/folio-feed-helm/values.yaml
git commit -m "analyzer image update: $GITHUB_SHA"
git push origin main