This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
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: Create and publish a Docker image | |
on: | |
workflow_dispatch: | |
inputs: | |
image-tag: | |
type: string | |
required: true | |
description: 'Docker image tag' | |
push: | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: ${{ github.repository }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
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: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Export docker tag | |
env: | |
INPUT_TAG: ${{ inputs.image-tag }} | |
run: | | |
export IMAGE_TAG=${INPUT_TAG:-$(git describe --tags | sed 's/V//')} | |
echo $IMAGE_TAG | |
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_ENV | |
# - name: Build and push | |
# uses: docker/build-push-action@v5 | |
# with: | |
# context: . | |
# platforms: linux/amd64,linux/arm64,windows/amd64 | |
# push: true | |
# tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }} |