fix: use last hsqs match for squashfs offset detection #535
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: "Build Docker Image" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 9 * * *" | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should-build: ${{ steps.decide.outputs.should-build }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Check if Base Image Updated | |
| id: image_update_check | |
| if: github.event_name == 'schedule' | |
| uses: lucacome/docker-image-update-checker@v2 | |
| with: | |
| base-image: "ubuntu:latest" | |
| image: "realies/soulseek:latest" | |
| - name: Decide Whether to Build | |
| id: decide | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ] || [ "${{ steps.image_update_check.outputs.needs-updating }}" = "true" ]; then | |
| echo "should-build=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "should-build=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| needs: check | |
| if: needs.check.outputs.should-build == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| tag: amd64 | |
| - platform: linux/arm64 | |
| tag: arm64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - 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.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and Push Image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| pull: true | |
| push: true | |
| tags: realies/soulseek:${{ matrix.tag }} | |
| platforms: ${{ matrix.platform }} | |
| cache-from: type=gha,scope=${{ matrix.tag }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.tag }} | |
| manifest: | |
| needs: [check, build] | |
| if: needs.check.outputs.should-build == 'true' && needs.build.result == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create and Push Multi-Arch Manifest | |
| run: | | |
| docker buildx imagetools create -t realies/soulseek:latest \ | |
| realies/soulseek:amd64 \ | |
| realies/soulseek:arm64 | |
| - name: Docker Image Digest | |
| run: docker buildx imagetools inspect realies/soulseek:latest |