-
-
Notifications
You must be signed in to change notification settings - Fork 117
151 lines (134 loc) · 4.29 KB
/
release.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-20.04
outputs:
published: ${{ steps.semantic.outputs.new_release_published }}
version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 14 # https://github.com/cycjimmy/semantic-release-action/issues/159
- name: Install dependencies
run: |
npm ci
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs:
- release
if: needs.release.outputs.published == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- id: meta
uses: docker/metadata-action@v4
with:
images: |
supabase/storage-api
public.ecr.aws/supabase/storage-api
436098097459.dkr.ecr.us-east-1.amazonaws.com/storage-api
646182064048.dkr.ecr.us-east-1.amazonaws.com/storage-api
ghcr.io/supabase/storage-api
tags: |
type=raw,value=v${{ needs.release.outputs.version }}
- uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64
- 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 - 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: 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 - prod
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: 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 }}
build-args: |
VERSION=${{ needs.release.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
mirror:
runs-on: ubuntu-latest
needs:
- release
- publish
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: 'us-east-1'
- uses: docker/login-action@v2
with:
registry: public.ecr.aws
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: akhilerm/[email protected]
with:
src: docker.io/supabase/storage-api:v${{ needs.release.outputs.version }}
dst: |
public.ecr.aws/supabase/storage-api:latest
docker.io/supabase/storage-api:latest
ghcr.io/supabase/storage-api:latest