feat: prepare supporter self-hosting
This commit is contained in:
50
.github/workflows/docker-build.yml
vendored
50
.github/workflows/docker-build.yml
vendored
@@ -23,6 +23,7 @@ jobs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
worker: ${{ steps.filter.outputs.worker }}
|
||||
public: ${{ steps.filter.outputs.public }}
|
||||
dashboard: ${{ steps.filter.outputs.dashboard }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v2
|
||||
@@ -42,10 +43,14 @@ jobs:
|
||||
- 'apps/public/**'
|
||||
- 'packages/**'
|
||||
- '.github/workflows/**'
|
||||
dashboard:
|
||||
- 'apps/start/**'
|
||||
- 'packages/**'
|
||||
- '.github/workflows/**'
|
||||
|
||||
lint-and-test:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.worker == 'true' || needs.changes.outputs.public == 'true' }}
|
||||
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.worker == 'true' || needs.changes.outputs.public == 'true' || needs.changes.outputs.dashboard == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
redis:
|
||||
@@ -181,3 +186,46 @@ jobs:
|
||||
ghcr.io/${{ env.repo_owner }}/worker:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }}
|
||||
build-args: |
|
||||
DATABASE_URL=postgresql://dummy:dummy@localhost:5432/dummy
|
||||
|
||||
build-and-push-dashboard:
|
||||
permissions:
|
||||
packages: write
|
||||
needs: [changes, lint-and-test]
|
||||
if: ${{ needs.changes.outputs.dashboard == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate tags
|
||||
id: tags
|
||||
run: |
|
||||
# Sanitize branch name by replacing / with -
|
||||
BRANCH_NAME=$(echo "${{ github.ref_name }}" | sed 's/\//-/g')
|
||||
# Get first 4 characters of commit SHA
|
||||
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-4)
|
||||
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
||||
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- 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: .
|
||||
file: apps/start/Dockerfile
|
||||
push: true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
tags: |
|
||||
ghcr.io/${{ env.repo_owner }}/dashboard:${{ steps.tags.outputs.branch_name }}-${{ steps.tags.outputs.short_sha }}
|
||||
build-args: |
|
||||
NO_CLOUDFLARE=1
|
||||
|
||||
Reference in New Issue
Block a user