From 98fdc8cefb4da58538a48e8ae8cdc3621ab57d4f Mon Sep 17 00:00:00 2001 From: Akito Date: Thu, 12 Oct 2023 15:50:27 +0200 Subject: [PATCH] Add Github Workflow for Alpine Docker Image Build and Push --- .../docker-build-push-app-alpine.yml | 65 +++++++++++++++++++ .../workflows/docker-build-push-app-jammy.yml | 11 +++- 2 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker-build-push-app-alpine.yml diff --git a/.github/workflows/docker-build-push-app-alpine.yml b/.github/workflows/docker-build-push-app-alpine.yml new file mode 100644 index 0000000..667ce2d --- /dev/null +++ b/.github/workflows/docker-build-push-app-alpine.yml @@ -0,0 +1,65 @@ +name: Docker Image Build and Push - Alpine + +on: + push: + branches: + - master + tags: + - "*.*.*" + pull_request: + +jobs: + + build-push: + + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Git Metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: | + akito13/nim + flavor: | + latest=true + prefix= + suffix= + tags: | + type=raw,value=alpine + type=raw,value=musl + type=schedule,pattern={{date 'YYYYMMDD'}}-alpine + type=ref,suffix=-alpine,event=branch + type=ref,suffix=-alpine,event=pr + type=semver,pattern={{version}}-alpine + type=semver,pattern={{major}}.{{minor}}-alpine + type=semver,pattern={{major}}-alpine + type=sha,prefix=,suffix=-alpine,format=long + type=sha,prefix=,suffix=-alpine,format=short + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + with: + driver-opts: | + image=moby/buildkit:v0.12.0 + buildkitd-flags: --debug + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/ppc64le,linux/arm/v7,linux/arm64/v8,linux/386,linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-build-push-app-jammy.yml b/.github/workflows/docker-build-push-app-jammy.yml index 170f377..95aec73 100644 --- a/.github/workflows/docker-build-push-app-jammy.yml +++ b/.github/workflows/docker-build-push-app-jammy.yml @@ -1,10 +1,9 @@ -name: Docker Image Build and Push +name: Docker Image Build and Push - Ubuntu on: push: branches: - master - - docker/build-push-action#910 tags: - "*.*.*" pull_request: @@ -30,14 +29,20 @@ jobs: suffix= tags: | type=edge,branch=master + type=raw,value=libc + type=raw,value=ubuntu type=raw,value=jammy type=raw,value=jammy-20230916 - type=schedule + type=schedule,pattern={{date 'YYYYMMDD'}} + type=schedule,pattern={{date 'YYYYMMDD'}}-ubuntu type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + type=semver,pattern={{version}}-ubuntu + type=semver,pattern={{major}}.{{minor}}-ubuntu + type=semver,pattern={{major}}-ubuntu type=sha,prefix=,format=long type=sha,prefix=,format=short