diff --git a/.github/workflows/beta-server-image.yml b/.github/workflows/beta-server-image.yml new file mode 100644 index 0000000..25ae743 --- /dev/null +++ b/.github/workflows/beta-server-image.yml @@ -0,0 +1,75 @@ +name: Beta Server Image + +# Publishes the relay server as a Docker image under NON-production tags so a +# feature branch can be deployed to a staging/backup server and used as a custom +# server, without ever touching the ':latest' tag the official relay tracks. +# +# Tags produced (on ghcr.io//): +# - beta moving channel pointer to the newest build +# - e.g. feature-host-control-mode +# - sha- immutable, pin to an exact build +# - only on manual run, e.g. hostcontrol01 +# Never ':latest' (flavor: latest=false). +# +# Remove this workflow once the feature is merged & released the normal way. + +on: + push: + branches: + - feature/host-control-mode + workflow_dispatch: + inputs: + tag: + description: 'Extra immutable tag for this build (e.g. hostcontrol01). Optional.' + required: false + default: '' + +concurrency: + group: beta-image-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-beta-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v6 + with: + images: ghcr.io/${{ github.repository }} + # Never publish ':latest' from a beta build. + flavor: | + latest=false + tags: | + type=raw,value=beta + type=ref,event=branch + type=sha,prefix=sha- + type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' }} + + - name: Build and push Docker image + uses: docker/build-push-action@v7 + with: + context: . + file: server/Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max