add build and push step #7
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
on: | |
push: | |
branches: | |
- test | |
jobs: | |
checkout_Dockerfile: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- id: checkout | |
name: checkout Dockerfile | |
uses: 'actions/checkout@v4' | |
- name: Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
create_credentials_file: true | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.GCP_SA_EMAIL }} | |
- name: Build and push | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REGISTRY_PREFIX }}/${{ github.repository }}:${{ github.ref_name }} | |
labels: | | |
maintainer=AI DIAL |