Add Docker publish workflow and remove recovered production files
Build and publish Docker image / build-and-publish (push) Successful in 3m19s

This commit is contained in:
wfalkowski committed 2026-10-19 18:56:21 +00:00
1 parent 88736cd35d
commit 364eb18bb1
10 files changed
+14 -118

No files matched your search

+14 -18
View File
@@ -8,7 +8,6 @@ on:
permissions:
contents: read
packages: write
jobs:
build-and-publish:
@@ -17,33 +16,30 @@ jobs:
- name: Check out source
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
- name: Log in to Docker Hub
env:
REGISTRY_USER: ${{ gitea.actor }}
REGISTRY_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: printf '%s' "$REGISTRY_TOKEN" | docker login git.anchorhost.eu --username "$REGISTRY_USER" --password-stdin
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
printf '%s' "$DOCKERHUB_TOKEN" |
docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- name: Build and tag image
env:
COMMIT_SHA: ${{ gitea.sha }}
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
run: |
image='git.anchorhost.eu/anchorhost.eu/anchorhost-frontend'
short_sha="$(printf '%.12s' "$COMMIT_SHA")"
docker build \
--label "org.opencontainers.image.revision=$COMMIT_SHA" \
--tag "$image:main-$short_sha" \
--tag "$image:main-latest" \
--tag "$DOCKER_IMAGE:frontend" \
.
- name: Push image tags
- name: Push image
env:
COMMIT_SHA: ${{ gitea.sha }}
run: |
image='git.anchorhost.eu/anchorhost.eu/anchorhost-frontend'
short_sha="$(printf '%.12s' "$COMMIT_SHA")"
docker push "$image:main-$short_sha"
docker push "$image:main-latest"
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
run: docker push "$DOCKER_IMAGE:frontend"
- name: Log out from Gitea Container Registry
- name: Log out from Docker Hub
if: always()
run: docker logout git.anchorhost.eu
run: docker logout