-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.63 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: Deploy
"on":
- push
env:
IMAGE_REGISTRY: ${{ secrets.IMAGES_LOCATION }}-docker.pkg.dev/${{ secrets.IMAGES_PROJECT_ID }}/router
jobs:
build:
name: Build
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- uses: docker/setup-buildx-action@v3
- uses: TheHackerApp/setup-ssh@main
with:
private-key: |
${{ secrets.SHIPYARD_SSH_KEY }}
${{ secrets.APOLLO_ROUTER_DEPLOY_KEY }}
host: |
ssh.shipyard.rs
github.com
- uses: TheHackerApp/setup-artifact-registry@main
with:
registries: ${{ secrets.IMAGES_LOCATION }}-docker.pkg.dev
project_id: ${{ secrets.IMAGES_PROJECT_ID }}
workload_identity_provider: ${{ secrets.IMAGES_WORKLOAD_IDENTITY_PROVIDER }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.IMAGE_REGISTRY }}/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:
push: true
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