Create docker-multiplatform-tag.yml
This commit is contained in:
parent
5bbfcee0b6
commit
8dd4d0fda4
1 changed files with 69 additions and 0 deletions
69
.github/workflows/docker-multiplatform-tag.yml
vendored
Normal file
69
.github/workflows/docker-multiplatform-tag.yml
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
---
|
||||||
|
name: 'Build Docker On Tag'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- bigip-server
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
workflow_dispatch: # Allows manual triggering from the GitHub UI
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
|
||||||
|
|
||||||
|
# If this is a git tag, use the tag name as a docker tag
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/v}
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If this is a git branch, use the branch name as a docker tag
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/heads/}
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the VERSION looks like a version number, also tag as 'latest'
|
||||||
|
if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set output parameters
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.prep.outputs.tags }}
|
Loading…
Reference in a new issue