diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe23031..aed10a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,8 @@ jobs: - uses: actions/checkout@v3 - name: Log in to registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@master @@ -74,11 +76,13 @@ jobs: with: context: . push: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 tags: | ghcr.io/${{ github.repository }}:${{ github.sha }} build-args: | RUBY_VERSION=${{ steps.ruby-version.outputs.ruby-version }} + cache-from: type=gha + cache-to: type=gha,mode=max update-release-draft: runs-on: ubuntu-latest if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e961f9..471d1f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,14 +8,22 @@ jobs: docker-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - name: Log in to registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Pull built image - run: docker pull ghcr.io/${{ github.repository }}:${{ github.sha }} - - name: Tag image with version Tag - run: docker tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:${{ github.event.release.name }} - - name: Tag image as latest - run: docker tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:latest - - name: Push to registry - run: docker push ghcr.io/${{ github.repository }}:latest && docker push ghcr.io/${{ github.repository }}:${{ github.event.release.name }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + - name: Write dockerfile for release + run: | + echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >Dockerfile + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/${{ github.repository }}:${{ github.event.release.name }} + ghcr.io/${{ github.repository }}:latest