-
Notifications
You must be signed in to change notification settings - Fork 29
57 lines (46 loc) · 1.53 KB
/
kube.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
name: Deploy to GKE
on:
push:
tags:
- v*
jobs:
build:
name: Building and push image to gcr
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure GCR credentials
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCR_SERVICE_ACCOUNT_KEY }}
project_id: ${{ secrets.PROJECT_ID }}
export_default_credentials: true
- name: Configure Docker Client
run: |-
gcloud auth configure-docker --quiet
- name: Get tag
run: echo "tag=$(echo ${GITHUB_REF_NAME})" >>$GITHUB_OUTPUT
id: get-tag
- name: Get short sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
id: get-short
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image web and push it
uses: docker/build-push-action@v5
with:
push: true
file: Dockerfile
tags: |
eu.gcr.io/spotistats-a49da/web:${{ steps.get-tag.outputs.tag }}-${{ steps.get-short.outputs.sha_short }}
eu.gcr.io/spotistats-a49da/web:latest
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PAT }}
repository: statsfm/argocd
event-type: image-updates-web
client-payload: '{"tag": "${{ steps.get-tag.outputs.tag }}-${{ steps.get-short.outputs.sha_short }}"}'