43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Publish Docker image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
env:
|
|
REGISTRY: forge.lclr.dev
|
|
IMAGE_NAME: thibaud-lclr/api-client
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: docker
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y docker.io
|
|
|
|
- name: Log in to Forgejo registry
|
|
run: |
|
|
printf '%s' "${{ secrets.FORGEJO_REGISTRY_TOKEN }}" \
|
|
| docker login "${REGISTRY}" \
|
|
--username "${{ secrets.FORGEJO_REGISTRY_USERNAME }}" \
|
|
--password-stdin
|
|
|
|
- name: Build and push image
|
|
run: |
|
|
IMAGE_TAG="${REGISTRY}/${IMAGE_NAME}:${{ github.ref_name }}"
|
|
docker build \
|
|
--file prod.Dockerfile \
|
|
--target aio \
|
|
--label "org.opencontainers.image.source=https://${REGISTRY}/${IMAGE_NAME}" \
|
|
--label "org.opencontainers.image.revision=${{ github.sha }}" \
|
|
--label "org.opencontainers.image.version=${{ github.ref_name }}" \
|
|
--tag "${IMAGE_TAG}" \
|
|
.
|
|
docker push "${IMAGE_TAG}"
|