Skip to content

workflows: fetch tags when cloning repo (bug 1938436) (#214) #86

workflows: fetch tags when cloning repo (bug 1938436) (#214)

workflows: fetch tags when cloning repo (bug 1938436) (#214) #86

Workflow file for this run

name: Lando Deployment
on:
push:
branches:
- develop
- staging
release:
types:
- published
env:
IMAGE_NAME: lando
GAR_LOCATION: us
GCP_PROJECT_ID: moz-fx-lando-prod
GAR_REPOSITORY: lando-prod
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build the Docker image
run: docker build -t lando .
deploy:
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: docker/setup-buildx-action@v2
- id: gcp-auth
name: Google authentication
uses: google-github-actions/auth@v2
with:
token_format: "access_token"
service_account: artifact-writer@${{ env.GCP_PROJECT_ID }}.iam.gserviceaccount.com
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER }}
- name: Log in to the container registry
uses: docker/login-action@v2
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp-auth.outputs.access_token }}
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
tags: |
${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/lando:${{ github.ref_name }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max