Docker Publish Preview #699
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Publish Preview | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| types: | |
| - completed | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| APP_NAME: subsonic-player | |
| jobs: | |
| deploy: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch 🛎 | |
| uses: actions/checkout@v6 | |
| - name: Get Node version 📋 | |
| id: node-version | |
| run: echo "version=$(cat .nvmrc)" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx 🏗 | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to DockerHub 🔐 | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU 🖥️ | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build and push Docker image 📦 | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| build-args: | | |
| NODE_VERSION=${{ steps.node-version.outputs.version }} | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}:preview |