|
7 | 7 |
|
8 | 8 | permissions: |
9 | 9 | contents: read |
| 10 | + packages: write |
10 | 11 |
|
11 | 12 | jobs: |
12 | 13 | build-phar: |
|
38 | 39 | if: ${{startsWith(github.ref, 'refs/tags/') }} |
39 | 40 | with: |
40 | 41 | files: pie.phar |
| 42 | + |
| 43 | + docker-binary-only-image: |
| 44 | + needs: build-phar |
| 45 | + name: Docker binary-only image |
| 46 | + runs-on: ubuntu-latest |
| 47 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Checkout repository |
| 51 | + uses: actions/checkout@v4 |
| 52 | + |
| 53 | + - name: Restore built PHAR |
| 54 | + uses: actions/download-artifact@v4 |
| 55 | + with: |
| 56 | + name: phar-binary |
| 57 | + |
| 58 | + - name: Set up QEMU |
| 59 | + uses: docker/setup-qemu-action@v3 |
| 60 | + |
| 61 | + - name: Set up Docker Buildx |
| 62 | + uses: docker/setup-buildx-action@v3 |
| 63 | + |
| 64 | + - name: Log in to the Container registry |
| 65 | + uses: docker/login-action@v3 |
| 66 | + with: |
| 67 | + registry: ghcr.io |
| 68 | + username: ${{ github.actor }} |
| 69 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + |
| 71 | + - name: Extract metadata (tags, labels) for Docker |
| 72 | + id: meta |
| 73 | + uses: docker/metadata-action@v5 |
| 74 | + with: |
| 75 | + flavor: | |
| 76 | + latest=false |
| 77 | + suffix=-bin |
| 78 | + images: ghcr.io/${{ github.repository }} |
| 79 | + tags: | |
| 80 | + type=raw,value=latest-bin |
| 81 | + type=semver,pattern={{version}} |
| 82 | + type=semver,pattern={{major}}.{{minor}} |
| 83 | + type=semver,pattern={{major}} |
| 84 | +
|
| 85 | + - name: Build and push Docker image |
| 86 | + uses: docker/build-push-action@v5 |
| 87 | + with: |
| 88 | + context: . |
| 89 | + platforms: linux/amd64,linux/arm64 |
| 90 | + file: Dockerfile |
| 91 | + target: standalone-binary |
| 92 | + push: true |
| 93 | + tags: ${{ steps.meta.outputs.tags }} |
| 94 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments