Skip to content

Test and authenticate with google cloud #3

Test and authenticate with google cloud

Test and authenticate with google cloud #3

Workflow file for this run

name: Deploy
on:
- push
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: docker/setup-buildx-action@v3
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SHIPYARD_SSH_KEY }}
- name: Add Shipyard host key to .ssh/known_hosts
run: |
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
ssh-keyscan ssh.shipyard.rs >> ~/.ssh/known_hosts
- uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.IMAGES_PROJECT_ID }}
workload_identity_provider: ${{ secrets.IMAGES_WORKLOAD_IDENTITY_PROVIDER }}
- uses: google-github-actions/setup-gcloud@v2
- run: gcloud artifacts repositories list --location ${{ secrets.IMAGES_LOCATION }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ secrets.IMAGES_LOCATION }}-docker.pkg.dev/${{ secrets.IMAGES_PROJECT_ID }}/identity/service
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix=deploy-,enable={{is_default_branch}}
type=sha
- uses: docker/build-push-action@v5
with:
# TODO: change to pushing to GCP on default branch
push: false
sbom: true
provenance: mode=max
secrets: |
shipyard-token=${{ secrets.SHIPYARD_TOKEN }}
ssh: |
default=${{ env.SSH_AUTH_SOCK }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-to: type=gha,mode=max
cache-from: type=gha