-
Notifications
You must be signed in to change notification settings - Fork 373
96 lines (83 loc) · 2.74 KB
/
publish.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Publish to Image Registry
on:
workflow_call:
inputs:
version:
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: meta
uses: docker/metadata-action@v4
with:
images: |
supabase/gotrue
public.ecr.aws/supabase/gotrue
ghcr.io/supabase/gotrue
ghcr.io/supabase/auth
436098097459.dkr.ecr.us-east-1.amazonaws.com/gotrue
646182064048.dkr.ecr.us-east-1.amazonaws.com/gotrue
supabase/auth
public.ecr.aws/supabase/auth
436098097459.dkr.ecr.us-east-1.amazonaws.com/auth
646182064048.dkr.ecr.us-east-1.amazonaws.com/auth
flavor: |
latest=false
tags: |
type=raw,value=v${{ inputs.version }},enable=true
- uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64
- run: |
set -ex
echo "Adding explicit release version to Dockerfile..."
sed -i 's/RELEASE_VERSION=unspecified/RELEASE_VERSION=${{ inputs.version }}/' Dockerfile
- uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials - prod
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: us-east-1
- name: Login to ECR
uses: docker/login-action@v2
with:
registry: public.ecr.aws
- name: Login to ECR account - prod
uses: docker/login-action@v2
with:
registry: 646182064048.dkr.ecr.us-east-1.amazonaws.com
- name: configure aws credentials - staging
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
aws-region: us-east-1
- name: Login to ECR account - staging
uses: docker/login-action@v2
with:
registry: 436098097459.dkr.ecr.us-east-1.amazonaws.com
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max