Publish Docker CI image #36
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: Publish Docker CI image | |
on: | |
workflow_dispatch: {} | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
paths: ["swift-ci/**"] | |
jobs: | |
push_to_registry: | |
name: Push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- dockerfile: swift-ci/main/ubuntu/18.04/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | |
- ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04 | |
- dockerfile: swift-ci/main/ubuntu/20.04/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | |
- ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04 | |
- dockerfile: swift-ci/main/ubuntu/22.04/Dockerfile | |
platforms: linux/amd64 # FIXME: linux/arm64 build didn't work on QEMU | |
tags: | |
- ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04 | |
- dockerfile: swift-ci/main/amazon-linux/2/Dockerfile | |
platforms: linux/amd64 | |
tags: | |
- ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.SWIFTWASM_PERSONAL_TOKEN }} | |
- name: Push ${{ matrix.dockerfile }} | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ matrix.platforms }} | |
context: . | |
file: ${{ matrix.dockerfile }} | |
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
tags: ${{ join(matrix.tags, ',') }} |