diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 432b7724..00000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build and publish a Docker image to Docker hub and ghcr.io -on: - release: - types: [published] - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v3 - with: - images: | - ${{ github.repository }} - ghcr.io/${{ github.repository }} - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: 'arm64,arm' - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - platforms: linux/arm64,linux/amd64,linux/arm/v7 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - platforms: ${{ steps.buildx.outputs.platforms }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ab6c7c3..6a8e0a58 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,3 +35,43 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} if: ${{ steps.release.outputs.release_created }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: 'arm64,arm' + if: ${{ steps.release.outputs.release_created }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64,linux/amd64,linux/arm/v7 + if: ${{ steps.release.outputs.release_created }} + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ steps.release.outputs.release_created }} + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + if: ${{ steps.release.outputs.release_created }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: ${{ steps.buildx.outputs.platforms }} + push: true + tags: | + type=semver,pattern={{steps.release.outputs.major}}.{{steps.release.outputs.minor}}.{{steps.release.outputs.patch}} + type=semver,pattern={{steps.release.outputs.major}}.{{steps.release.outputs.minor}} + type=semver,pattern={{steps.release.outputs.major}} + if: ${{ steps.release.outputs.release_created }}