name: Docker Release on: workflow_dispatch: inputs: platforms: type: choice description: 'Build Platforms' required: true default: 'linux/amd64' options: - 'linux/amd64' - 'linux/amd64,linux/arm64' push: branches: - master release: types: - published jobs: build_and_push_docker: runs-on: ubuntu-latest env: dev_arch: 'linux/amd64' release_arch: 'linux/amd64,linux/arm64' permissions: contents: read packages: write steps: - name: Checkout uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: | docker.io/keglin/pinchflat ghcr.io/${{ github.repository }} tags: | type=semver,pattern={{version}},prefix=v type=semver,pattern={{major}}.{{minor}},prefix=v type=semver,pattern={{major}},prefix=v type=raw,value=dev,enable=${{ github.event_name != 'release' }} flavor: | latest=auto - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Echo outputs run: | echo "${{ github.event_name }}" echo "${{ steps.meta.outputs.tags }}" echo "${{ steps.meta.outputs.labels }}" echo "${{ github.event.inputs.platforms }}" echo "${{ github.event.inputs.platforms || env.release_arch }}" echo "${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }}" - name: Build and Push uses: docker/build-push-action@v5 with: context: . file: ./selfhosted.Dockerfile platforms: ${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }} push: false # TODO: Set to true once everything is proven to work tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}