Skip to content

Update buildpush.yml #21

Update buildpush.yml

Update buildpush.yml #21

Workflow file for this run

# For more support on how to run the workflow, please visit https://github.com/google-github-actions/setup-gcloud/tree/master/example-workflows/gke-kustomize
name: Build and Push to GCR
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
PROJECT_ID: maplectf
GCR_URL: us.gcr.io
IMAGE: instanced
TAG: ${{ env.GCR_URL }}/${{ env.PROJECT_ID }}/${{ env.IMAGE }}:latest

Check failure on line 18 in .github/workflows/buildpush.yml

View workflow run for this annotation

GitHub Actions / Build and Push to GCR

Invalid workflow file

The workflow is not valid. .github/workflows/buildpush.yml (Line: 18, Col: 8): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GCR_URL
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: self-hosted
environment: production
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: 'Set up gcloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
with:
version: '442.0.0'
- name: Check gcloud
run: |
set -x
gcloud info
- uses: 'actions/checkout@v3'
- id: 'auth'
name: 'Authenticate to GCP'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
project_id: $PROJECT_ID
- name: Docker configuration
run: |-
gcloud auth configure-docker $GCR_URL
# Build and Push the Docker image
- name: Build
uses: docker/build-push-action@v2
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ env.TAG }}