Skip to content

Merge pull request #3 from gynzy/SRE-303 #5

Merge pull request #3 from gynzy/SRE-303

Merge pull request #3 from gynzy/SRE-303 #5

name: publish-docker-prod
on:
push:
branches:
- 'master'
jobs:
publish-docker-prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.GCE_NEW_TEST_JSON }}
project_id: gynzy-test-project
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- run: |-
gcloud auth configure-docker europe-docker.pkg.dev
# Build the Docker image
- name: Build
run: |-
docker build \
--tag "europe-docker.pkg.dev/gynzy-test-project/public-images/push-to-gcr-github-action:${{ github.sha }}" --tag "europe-docker.pkg.dev/gynzy-test-project/public-images/push-to-gcr-github-action:v1" .
# Push the Docker image to Google Container Registry
- name: Publish
run: |-
docker push "europe-docker.pkg.dev/gynzy-test-project/public-images/push-to-gcr-github-action:${{ github.sha }}"
docker push "europe-docker.pkg.dev/gynzy-test-project/public-images/push-to-gcr-github-action:v1"