Repository navigation
revert(skills): remove global anti-slop installer #6631
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: Docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.sha }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} | |
| jobs: | |
| docker-build-push: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - platform: linux/amd64 | |
| arch: amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.build.runner }} | |
| timeout-minutes: 300 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Free Disk Space (Ubuntu) | |
| if: runner.os == 'Linux' | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| with: | |
| tool-cache: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| swap-storage: true | |
| - name: Relocate Docker Data Root to /mnt | |
| if: runner.os == 'Linux' | |
| run: make docker-relocate-root | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set Metadata | |
| id: metadata | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| flavor: | | |
| suffix=-${{ matrix.build.arch }} | |
| latest=${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && 'false' || 'auto' }} | |
| tags: | | |
| type=sha,format=short,suffix=-${{ matrix.build.arch }},enable=${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| type=raw,value=latest,suffix=-${{ matrix.build.arch }},enable=${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| type=sha,format=short,enable=${{ !(github.ref == 'refs/heads/main' && github.event_name == 'push') }} | |
| type=semver,pattern={{version}},enable=${{ !(github.ref == 'refs/heads/main' && github.event_name == 'push') }} | |
| type=semver,pattern={{raw}},enable=${{ !(github.ref == 'refs/heads/main' && github.event_name == 'push') }} | |
| type=raw,value=latest,enable=${{ !(github.ref == 'refs/heads/main' && github.event_name == 'push') }} | |
| labels: | | |
| org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} | |
| org.opencontainers.image.source=${{ github.event.pull_request.html_url || github.event.repository.html_url }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.pr-number=${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }} | |
| - name: Build and Push Docker | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: ${{ matrix.build.platform }} | |
| push: true | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| labels: ${{ steps.metadata.outputs.labels }} | |
| build-args: | | |
| COMMIT_SHA=${{ github.sha }} | |
| GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_PR=${{ github.event.pull_request.number }} | |
| cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.build.arch }} | |
| cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.build.arch }},mode=max | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: digests-${{ matrix.build.arch }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| docker-merge-manifests: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: | |
| - docker-build-push | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Login to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Set Metadata | |
| id: metadata | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| tags: | | |
| type=sha,format=short | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{raw}} | |
| type=raw,value=latest | |
| - name: Create manifest list and push | |
| env: | |
| DOCKER_METADATA_OUTPUT_JSON: ${{ steps.metadata.outputs.json }} | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| tag_args=() | |
| while IFS= read -r tag; do | |
| tag_args+=("-t" "$tag") | |
| done < <(jq -cr '.tags[]' <<< "$DOCKER_METADATA_OUTPUT_JSON") | |
| refs=() | |
| for digest_file in *; do | |
| refs+=("${REGISTRY_IMAGE}@sha256:${digest_file}") | |
| done | |
| if [ ${#refs[@]} -eq 0 ]; then | |
| echo "No digests found" >&2 | |
| exit 1 | |
| fi | |
| docker buildx imagetools create "${tag_args[@]}" "${refs[@]}" | |
| - name: Inspect image | |
| env: | |
| DOCKER_METADATA_OUTPUT_JSON: ${{ steps.metadata.outputs.json }} | |
| run: | | |
| ref=$(jq -r '.tags[0]' <<< "$DOCKER_METADATA_OUTPUT_JSON") | |
| docker buildx imagetools inspect "$ref" | |
| docker-check: | |
| if: always() | |
| needs: | |
| - docker-build-push | |
| - docker-merge-manifests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: Alls Green | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| allowed-skips: docker-build-push,docker-merge-manifests | |
| jobs: ${{ toJSON(needs) }} |