From af138dcb97cde7946aea87b645ddc936253197b8 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 9 Aug 2023 19:01:24 +0200 Subject: [PATCH] Fix #396: split container.yml in two, for releases and testing As of this commit the responsibility between the two workflows is delegated as follows: 1. full arch support will only be available via Docker Hub 2. GHCR will be solely used for regression testing the Dockerfile The Docker Hub workflow will only run on new releases (tags), whereas the GHCR workflow runs on every push to the master branch, and every new release. Signed-off-by: Joachim Wiberg --- .github/workflows/docker.yml | 35 +++++++++++++++++++ .github/workflows/{container.yml => ghcr.yml} | 29 +-------------- 2 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/docker.yml rename .github/workflows/{container.yml => ghcr.yml} (55%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..bd55f270 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,35 @@ +name: Container Claus + +on: + push: + tags: + - '*' + +jobs: + docker: + runs-on: ubuntu-latest + env: + MAKEFLAGS: -j3 + SOURCE_COMMIT: ${GITHUB_SHA} + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Find build version + id: vars + run: | + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + if [ "$VERSION" = "master" ]; then + echo "tags=troglobit/inadyn:build-${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT + else + echo "tags=troglobit/inadyn:$VERSION,troglobit/inadyn:latest" >> $GITHUB_OUTPUT + fi + - uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ steps.vars.outputs.tags }} + platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le diff --git a/.github/workflows/container.yml b/.github/workflows/ghcr.yml similarity index 55% rename from .github/workflows/container.yml rename to .github/workflows/ghcr.yml index 272cdf3f..b57eaf3f 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/ghcr.yml @@ -1,4 +1,4 @@ -name: Container Claus +name: Container Regression Testing on: push: @@ -8,33 +8,6 @@ on: - '*' jobs: - docker: - runs-on: ubuntu-latest - env: - MAKEFLAGS: -j3 - SOURCE_COMMIT: ${GITHUB_SHA} - steps: - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Find build version - id: vars - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - if [ "$VERSION" = "master" ]; then - echo "tags=troglobit/inadyn:build-${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT - else - echo "tags=troglobit/inadyn:$VERSION,troglobit/inadyn:latest" >> $GITHUB_OUTPUT - fi - - uses: docker/build-push-action@v4 - with: - push: true - tags: ${{ steps.vars.outputs.tags }} - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le ghcr: runs-on: ubuntu-latest permissions: