Publish frontend image to Gitea registry
Build and publish Docker image / build-and-publish (push) Failing after 5s
Build and publish Docker image / build-and-publish (push) Failing after 5s
This commit is contained in:
1 parent
364eb18bb1
commit
59d2a5aab3
2 files changed
+16
-11
No files matched your search
@@ -8,6 +8,7 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
@@ -16,30 +17,34 @@ jobs:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
- name: Log in to Gitea Container Registry
|
||||
env:
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
REGISTRY_USERNAME: ${{ gitea.actor }}
|
||||
REGISTRY_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
printf '%s' "$DOCKERHUB_TOKEN" |
|
||||
docker login --username "$DOCKERHUB_USERNAME" --password-stdin
|
||||
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: ${{ secrets.DOCKER_IMAGE }}
|
||||
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:
|
||||
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
|
||||
run: docker push "$DOCKER_IMAGE:frontend"
|
||||
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 Docker Hub
|
||||
- name: Log out from Gitea Container Registry
|
||||
if: always()
|
||||
run: docker logout
|
||||
|
||||
Reference in new issue
Block a user