Publish HCW Docker image Admin #3
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: Publish HCW Docker image Admin | |
on: | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
HCW_ADMIN_IMAGE_NAME: hcw-admin | |
HCW_ADMIN_CONTEXT: ./admin | |
IMAGE_TAG: latest | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Load .env file | |
id: dotenv | |
uses: falti/dotenv-action@v1.1.2 | |
- name: Extract metadata (tags, labels) for Docker Admin v${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }} | |
id: meta-admin | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_ADMIN_IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}-${{ env.IMAGE_TAG }} | |
type=sha,prefix=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }}- | |
- name: Build and push HCW Admin v${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }} i18n Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ env.HCW_ADMIN_CONTEXT }} | |
build-args: | | |
HCW_ADMIN_VERSION=${{ steps.dotenv.outputs.HCW_ADMIN_VERSION }} | |
push: true | |
tags: ${{ steps.meta-admin.outputs.tags }} | |
labels: ${{ steps.meta-admin.outputs.labels }} |