|
| 1 | +name: Publish |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - 'main' |
| 6 | +permissions: |
| 7 | + contents: write |
| 8 | + packages: write |
| 9 | +jobs: |
| 10 | + release-to-ghcr: |
| 11 | + concurrency: |
| 12 | + group: release-to-ghcr |
| 13 | + cancel-in-progress: false |
| 14 | + runs-on: ${{ matrix.config.os }} |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + config: |
| 18 | + - { os: ubuntu-24.04, arch: amd64 } |
| 19 | + - { os: ubuntu-24.04-arm, arch: arm64 } |
| 20 | + steps: |
| 21 | + # Checkout push-to-registry action github repository |
| 22 | + - name: Checkout Push to Registry action |
| 23 | + uses: actions/checkout@v4 |
| 24 | + - name: Set up Docker Buildx |
| 25 | + uses: docker/setup-buildx-action@v3 |
| 26 | + - name: Login To GHCR |
| 27 | + uses: docker/login-action@v3 |
| 28 | + with: |
| 29 | + registry: ghcr.io |
| 30 | + username: ${{ github.actor }} |
| 31 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + - name: Build and push |
| 33 | + uses: docker/build-push-action@v6 |
| 34 | + with: |
| 35 | + context: . |
| 36 | + file: Dockerfile.deploy |
| 37 | + push: true |
| 38 | + tags: | |
| 39 | + ghcr.io/python/planetpython:${{ github.sha }}-${{ matrix.config.arch }} |
| 40 | + ghcr.io/python/planetpython:latest-${{ matrix.config.arch }} |
| 41 | +
|
| 42 | + create-manifests: |
| 43 | + runs-on: ubuntu-24.04-arm |
| 44 | + needs: [release-to-ghcr] |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Checkout Push to Registry action |
| 48 | + uses: actions/checkout@v4 |
| 49 | + - name: Set up Docker Buildx |
| 50 | + uses: docker/setup-buildx-action@v3 |
| 51 | + - name: Login To GHCR |
| 52 | + uses: docker/login-action@v3 |
| 53 | + with: |
| 54 | + registry: ghcr.io |
| 55 | + username: ${{ github.actor }} |
| 56 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Create SHA image and push |
| 58 | + run: | |
| 59 | + docker buildx imagetools create \ |
| 60 | + --tag ghcr.io/python/planetpython:${{ github.sha }} \ |
| 61 | + ghcr.io/python/planetpython:${{ github.sha }}-amd64 \ |
| 62 | + ghcr.io/python/planetpython:${{ github.sha }}-arm64 |
| 63 | +
|
| 64 | + - name: Create latest manifest and push |
| 65 | + run: | |
| 66 | + docker buildx imagetools create \ |
| 67 | + --tag ghcr.io/python/planetpython:latest \ |
| 68 | + ghcr.io/python/planetpython:latest-amd64 \ |
| 69 | + ghcr.io/python/planetpython:latest-arm64 |
0 commit comments