Skip to content

Commit

Permalink
Fix #396: split container.yml in two, for releases and testing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
troglobit committed Aug 9, 2023
1 parent 1f11468 commit af138dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 1 addition & 28 deletions .github/workflows/container.yml → .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Container Claus
name: Container Regression Testing

on:
push:
Expand All @@ -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:
Expand Down

0 comments on commit af138dc

Please sign in to comment.