Build/Push test wrapper container to GCR #42
Workflow file for this run
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
# This workflow will build a docker container, publish it to Google Container Registry, | |
name: Build/Push test wrapper container to GCR | |
on: | |
release: | |
types: [created] | |
env: | |
PROJECT_ID: ${{ secrets.GCR_PROJECT }} | |
IMAGE: ${{ secrets.GCR_IMAGE }} | |
jobs: | |
setup-build-publish: | |
name: Setup, Build, and Publish | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Setup gcloud CLI | |
- uses: google-github-actions/[email protected] | |
with: | |
service_account_key: ${{ secrets.GCR_KEY }} | |
project_id: ${{ secrets.GCR_PROJECT }} | |
# Configure Docker to use the gcloud command-line tool as a credential | |
# helper for authentication | |
- run: |- | |
gcloud --quiet auth configure-docker | |
# Build the Docker image | |
- name: Build | |
run: make build-test-wrapper | |
# Push the Docker image to Google Container Registry | |
- name: Publish | |
run: |- | |
docker tag "us.gcr.io/$PROJECT_ID/$IMAGE:latest" "us.gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA" | |
docker tag "us.gcr.io/$PROJECT_ID/$IMAGE:latest" "us.gcr.io/$PROJECT_ID/$IMAGE:${{ github.event.release.tag_name }}" | |
docker push "us.gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA" | |
docker push "us.gcr.io/$PROJECT_ID/$IMAGE:latest" | |
docker push "us.gcr.io/$PROJECT_ID/$IMAGE:${{ github.event.release.tag_name }}" | |