-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 1.47 KB
/
push.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
name: Push to GCR GitHub Action
on:
push:
paths-ignore:
- "**.md"
branches:
- "main"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
- name: Install dependecies
run: poetry install
- name: Execute pre-commit
run: poetry run pre-commit run -a --color=always --show-diff-on-failure
- name: Execute Unit Tests
run: poetry run make test
build-and-push-to-gcr:
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/setup-gcloud@v2
- name: Push image with commit hash tag
uses: RafikFarhad/[email protected]
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
image_name: ${{ github.event.repository.name }}
image_tag: ${{ github.sha }}
dockerfile: ./Dockerfile
- name: Push image with latest tag
uses: RafikFarhad/[email protected]
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
image_name: ${{ github.event.repository.name }}
image_tag: latest
dockerfile: ./Dockerfile