Files
anchorhost-frontend/.gitea/workflows/docker.yml
T
wfalkowski 59d2a5aab3
Build and publish Docker image / build-and-publish (push) Failing after 5s
Publish frontend image to Gitea registry
2026-10-20 15:45:59 +00:00

51 lines
1.3 KiB
YAML

name: Build and publish Docker image
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
env:
REGISTRY_USERNAME: ${{ gitea.actor }}
REGISTRY_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
printf '%s' "$REGISTRY_TOKEN" |
docker login git.anchorhost.eu --username "$REGISTRY_USERNAME" --password-stdin
- name: Build and tag image
env:
COMMIT_SHA: ${{ gitea.sha }}
DOCKER_IMAGE: git.anchorhost.eu/anchorhost.eu/anchorhost-frontend
run: |
docker build \
--label "org.opencontainers.image.revision=$COMMIT_SHA" \
--tag "$DOCKER_IMAGE:frontend" \
--tag "$DOCKER_IMAGE:main-${COMMIT_SHA:0:12}" \
.
- name: Push image
env:
COMMIT_SHA: ${{ gitea.sha }}
DOCKER_IMAGE: git.anchorhost.eu/anchorhost.eu/anchorhost-frontend
run: |
docker push "$DOCKER_IMAGE:frontend"
docker push "$DOCKER_IMAGE:main-${COMMIT_SHA:0:12}"
- name: Log out from Gitea Container Registry
if: always()
run: docker logout