-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.56 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
name: Build and Push Docker Image
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Check if Pull Request is Merged
id: check_merged
run: |
if [ "${{ github.event.pull_request.merged }}" != "true" ]; then
echo "This workflow only runs on merged pull requests."
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from version.txt
id: get_version
run: |
VERSION=$(cat version.txt)
echo "version=$VERSION" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.version }}
build-args: |
SUPABASE_CLI_VERSION=${{ env.version }}
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: |
This release contains the Docker image version ${{ github.ref_name }}.
draft: false
prerelease: false