Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Fix step

Fix step #6

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: Git describe
id: ghd
uses: proudust/gh-describe@v1
- name: Export docker tag
env:
INPUT_TAG: ${{ inputs.image-tag }}
FALLBACK_TAG: ${{ steps.ghd.outputs.describe }}
run: |
export IMAGE_TAG=${INPUT_TAG:-$FALLBACK_TAG}
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 }}