release-buildx #15
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: release-buildx | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
buildx: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64,amd64 | |
- | |
name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Set Release Tag Env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- | |
name: docker hub login | |
env: | |
DOCKER_USER: ${{secrets.DOCKER_USER}} | |
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
run: | | |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
- | |
name: docker ghcr login | |
env: | |
GHCR_USER: ${{secrets.GHCR_USER}} | |
GHCR_TOKEN: ${{secrets.GHCR_TOKEN}} | |
run: | | |
docker login ghcr.io -u $GHCR_USER -p $GHCR_TOKEN | |
- | |
name: Run Buildx | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
--output "type=image,push=true" \ | |
--file ./Dockerfile \ | |
--tag $GITHUB_REPOSITORY:$GITHUB_SHA \ | |
--tag $GITHUB_REPOSITORY:$RELEASE_VERSION \ | |
--tag $GITHUB_REPOSITORY:latest \ | |
--tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA \ | |
--tag ghcr.io/$GITHUB_REPOSITORY:$RELEASE_VERSION \ | |
--tag ghcr.io/$GITHUB_REPOSITORY:latest . | |