From 4e1db70c8fb606fadce1c9b7ac65d940721d0675 Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Tue, 2 Apr 2024 16:39:02 +0200 Subject: [PATCH 1/2] add initial GitHub action for building and pushing Docker images Signed-off-by: Peter Stadler --- .github/workflows/docker-publish.yml | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..7e5168d --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,65 @@ +name: Docker + +on: + # run on every push to any branch + push: + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + 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 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log in to GitHub registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: TEITechnicalCouncil + password: ${{ secrets.TEITECHNICALCOUNCIL_PACKAGES_TOKEN }} + + # Login against DockerHub registry except on PR + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.PETERS_DOCKERHUB_USERNAME }} + password: ${{ secrets.PETERS_DOCKERHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/teic/romajs + teic/romajs + flavor: | + latest=${{ github.ref == 'refs/heads/main' }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + platforms: | + linux/amd64 + linux/arm64/v8 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From cfcc45ddf622dbfe53f878ef9602d078cce4cf84 Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Tue, 2 Apr 2024 19:41:57 +0200 Subject: [PATCH 2/2] remove failing arm64 image build Signed-off-by: Peter Stadler --- .github/workflows/docker-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7e5168d..9645c2e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,6 +60,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} platforms: | linux/amd64 - linux/arm64/v8 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}