gcp-artifact-push #3
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: gcp-artifact-push | |
on: | |
workflow_run: | |
workflows: | |
- docker-release-build | |
types: | |
- completed | |
jobs: | |
push: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Wait for all workflows to pass | |
run: | | |
export GITHUB_SHA=${{ github.sha }} | |
export REPO_PATH=${{ github.repository }} | |
export GH_TOKEN=${{ secrets.GH_PAT }} | |
pip install -r test_requirements.txt | |
python .github/wait_for_workflow_artifacts.py google-cloud-deploy docker-hub-push gcp-artifact-push aws-deploy | |
- name: Wait for and download docker image artifact | |
uses: ./.github/actions/download-docker-artifact | |
with: | |
repo-read-token: ${{ secrets.GH_PAT }} | |
build-type: 'release' | |
- name: Authenticate with Google Cloud | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CLOUD_RUN_CREDENTIALS }}' | |
- name: Push to GCP artifact registry | |
run: | | |
docker tag django_app:latest europe-west1-docker.pkg.dev/fastapi-aws-django-gcp/djangorepo/django_app:latest | |
docker push europe-west1-docker.pkg.dev/fastapi-aws-django-gcp/djangorepo/django_app:latest |