Optimize: Migrate mischlabs fully to Gitea Local Package Registry
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s
This commit is contained in:
28
.github/workflows/docker-build.yml
vendored
28
.github/workflows/docker-build.yml
vendored
@@ -1,12 +1,12 @@
|
||||
name: Build & Push Docker Image to GHCR
|
||||
name: Build & Push Docker Image to Gitea Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: kroonk/mischlabs
|
||||
REGISTRY: git.mischlabs.de
|
||||
REGISTRY_IMAGE: git.mischlabs.de/mrdiderot/mischlabs
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
@@ -40,16 +40,20 @@ jobs:
|
||||
fi
|
||||
docker --version
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
password: ${{ secrets.GHCR_TOKEN }}
|
||||
- name: Log in to Gitea Package Registry
|
||||
shell: sh
|
||||
run: |
|
||||
if [ -z "${{ secrets.REGISTRY_USER }}" ] || [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then
|
||||
echo "Missing registry credentials."
|
||||
echo "Create repository secrets REGISTRY_USER and REGISTRY_TOKEN."
|
||||
echo "REGISTRY_TOKEN must be a Gitea access token with package write permission."
|
||||
exit 1
|
||||
fi
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY }}" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||
|
||||
- name: Build and push Docker image
|
||||
shell: sh
|
||||
run: |
|
||||
docker build -t ghcr.io/kroonk/mischlabs:latest -t ghcr.io/kroonk/mischlabs:${{ github.sha }} .
|
||||
docker push ghcr.io/kroonk/mischlabs:latest
|
||||
docker push ghcr.io/kroonk/mischlabs:${{ github.sha }}
|
||||
docker build -t ${{ env.REGISTRY_IMAGE }}:latest -t ${{ env.REGISTRY_IMAGE }}:${{ github.sha }} .
|
||||
docker push ${{ env.REGISTRY_IMAGE }}:latest
|
||||
docker push ${{ env.REGISTRY_IMAGE }}:${{ github.sha }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
mischlabs:
|
||||
image: ghcr.io/kroonk/mischlabs:latest
|
||||
image: git.mischlabs.de/mrdiderot/mischlabs:latest
|
||||
container_name: mischlabs
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user