successful production version #46
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: 'Build Docker image' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup-build-publish-deploy: | |
name: Setup, Build, Publish, and Deploy | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: europe-west6-docker.pkg.dev/ml-tf-398511/docker-repository/summarizer-app | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
# Authenticate using your service account credentials | |
- name: Authenticate using service account | |
run: | | |
gcloud auth activate-service-account --key-file=${{ github.workspace }}/infra/main/docker_service_account.json | |
# Configure docker to use the gcloud command-line tool as a credential helper | |
- name: Authentication for Docker | |
run: | | |
gcloud auth configure-docker europe-west6-docker.pkg.dev | |
# Build the Docker image | |
- name: Build the Docker image | |
run: | | |
docker build . --tag $IMAGE_NAME | |
# Push the Docker image to Google Container Registry | |
- name: Push to Google Container Registry | |
run: | | |
docker push $IMAGE_NAME |