docker #74
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 | |
on: | |
push: | |
tags: | |
- v*.* | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Calculate tag name | |
id: calculate_tag | |
run: | | |
if echo $GITHUB_REF | grep -q '^refs/tags/v'; then | |
VERSION=$(echo $GITHUB_REF | cut -d/ -f3); | |
TAG_NAME="${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:$VERSION"; | |
fi | |
echo '::set-output name=tag::'$TAG_NAME | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- name: Login to registry | |
uses: "docker/[email protected]" | |
with: | |
registry: ${{ env.REGISTRY }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
username: ${{ github.actor }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:stable,${{ steps.calculate_tag.outputs.tag }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |