Updated test to include env var patching #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |