diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d3bceeb..546804f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,21 +1,31 @@ name: release on: - create + workflow_dispatch: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + branches: + - 'main' jobs: docker: - if: ${{ startsWith(github.ref, 'refs/tags/v') }} runs-on: ubuntu-latest steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: hakindazz/s6-cli + tags: | + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} - name: Login to Docker Hub + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -24,5 +34,6 @@ jobs: name: Build and push uses: docker/build-push-action@v5 with: - push: true - tags: hakindazz/s6-cli:latest \ No newline at end of file + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file