Skip to content

Publish HCW Docker images Backend #19

Publish HCW Docker images Backend

Publish HCW Docker images Backend #19

name: Publish HCW Docker images Backend
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
HCW_BACKEND_IMAGE_NAME: hcw-backend
HCW_BACKEND_CONTEXT: ./backend
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/[email protected]
- name: Extract metadata (tags, labels) for Docker Backend v${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}
id: meta-backend
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.HCW_BACKEND_IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}-${{ env.IMAGE_TAG }}
type=sha,prefix=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}-
- name: Build and push HCW BACKEND v${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }} i18n Docker image
uses: docker/build-push-action@v5
with:
context: ${{ env.HCW_BACKEND_CONTEXT }}
build-args: |
HCW_BACKEND_VERSION=${{ steps.dotenv.outputs.HCW_BACKEND_VERSION }}
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}