Skip to content

Commit fe4dbdc

Browse files
authored
Merge branch 'prod' into main
2 parents 19e7f1d + fcd695b commit fe4dbdc

File tree

8 files changed

+222
-379
lines changed

8 files changed

+222
-379
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Always keep our version of workflow files during merges
2+
.github/workflows/* merge=ours
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Manual Docker Build & Release
2+
3+
on:
4+
push:
5+
branches:
6+
- prod
7+
workflow_dispatch:
8+
inputs:
9+
docker_tag:
10+
description: 'Docker tag for the image'
11+
required: true
12+
default: 'latest'
13+
type: string
14+
git_ref:
15+
description: 'Git ref to build (branch/tag/commit)'
16+
required: false
17+
default: 'main'
18+
type: string
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ inputs.git_ref || github.ref }}
32+
33+
- name: Extract version from mix.exs
34+
id: version
35+
run: |
36+
VERSION=$(grep -oP 'version: "\K[^"]+' mix.exs)
37+
echo "version=$VERSION" >> $GITHUB_OUTPUT
38+
echo "Extracted version: $VERSION"
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Login to GitHub Container Registry
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract metadata
51+
id: meta
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: ghcr.io/kbve/realtime
55+
tags: |
56+
type=raw,value=${{ inputs.docker_tag || 'latest' }}
57+
type=raw,value=v${{ steps.version.outputs.version }}
58+
type=sha,prefix={{branch}}-
59+
type=raw,value={{branch}}-{{date 'YYYYMMDD-HHmmss'}}
60+
labels: |
61+
org.opencontainers.image.title=Supabase Realtime
62+
org.opencontainers.image.description=Realtime server for Supabase
63+
org.opencontainers.image.vendor=Supabase
64+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
65+
66+
- name: Build and push Docker image
67+
uses: docker/build-push-action@v5
68+
with:
69+
context: .
70+
platforms: linux/amd64
71+
push: true
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}
74+
cache-from: type=gha
75+
cache-to: type=gha,mode=max
76+
77+
- name: Output image details
78+
run: |
79+
echo "## Docker Image Built Successfully! 🚀" >> $GITHUB_STEP_SUMMARY
80+
echo "" >> $GITHUB_STEP_SUMMARY
81+
echo "**Image Registry:** GitHub Container Registry" >> $GITHUB_STEP_SUMMARY
82+
echo "**Primary Tag:** \`ghcr.io/kbve/realtime:${{ inputs.docker_tag || 'latest' }}\`" >> $GITHUB_STEP_SUMMARY
83+
echo "**Version Tag:** \`ghcr.io/kbve/realtime:v${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
84+
echo "" >> $GITHUB_STEP_SUMMARY
85+
echo "### All Tags:" >> $GITHUB_STEP_SUMMARY
86+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
87+
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
88+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
89+
echo "" >> $GITHUB_STEP_SUMMARY
90+
echo "### Pull Command:" >> $GITHUB_STEP_SUMMARY
91+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
92+
echo "docker pull ghcr.io/kbve/realtime:${{ inputs.docker_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY
93+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
94+
echo "" >> $GITHUB_STEP_SUMMARY
95+
echo "### Run Command:" >> $GITHUB_STEP_SUMMARY
96+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
97+
echo "docker run -p 4000:4000 ghcr.io/kbve/realtime:${{ inputs.docker_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY
98+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

.github/workflows/manual_prod_build.yml

Lines changed: 0 additions & 129 deletions
This file was deleted.

.github/workflows/mirror.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)