-
-
Notifications
You must be signed in to change notification settings - Fork 197
94 lines (81 loc) · 3.01 KB
/
release.yml
File metadata and controls
94 lines (81 loc) · 3.01 KB
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
name: Release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
semantic-release:
name: Release
runs-on: ubuntu-24.04
outputs:
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }}
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }}
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
- name: Update npm
run: npm install -g npm@latest
- run: |
npm clean-install
npm run build
- id: semantic-release
uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
with:
semantic_version: 25.0.1 # version with latest npm and support for trusted publishing
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-hub:
name: Release on Docker Hub
needs:
- semantic-release
if: needs.semantic-release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT from AWS
contents: read
packages: write
steps:
- id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: |
supabase/postgres-meta
public.ecr.aws/supabase/postgres-meta
ghcr.io/supabase/postgres-meta
tags: |
type=raw,value=v${{ needs.semantic-release.outputs.new-release-version }}
- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
platforms: amd64,arm64
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to DockerHub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: us-east-1
- name: Login to ECR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: public.ecr.aws
- name: Login to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}