Docker packaging #7
Workflow file for this run
This file contains 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: Docker packaging | |
on: | |
push: | |
tags: | |
- 'basedon-*' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- 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 | |
- | |
name: Environment variables | |
run: env | |
- | |
name: Create images | |
env: | |
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | |
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} | |
DOCKERHUB_REPO: ${{ vars.DOCKERHUB_REPO }} | |
shell: bash | |
run: | | |
LATEST_TAG=${GITHUB_REF#refs/tags/} | |
LATEST_TAG=${LATEST_TAG:8} #trim "basedon-" from tag | |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin | |
docker buildx create --use | |
DOCKER_BUILDX_OPTS="--platform linux/amd64,linux/arm64,linux/arm/v7 --push" | |
docker buildx build $DOCKER_BUILDX_OPTS -t $DOCKERHUB_REPO:$LATEST_TAG . |