feat(workflows): add Docker CI/CD for Forgejo, refine Docker Hub flow
Introduced a new CI/CD workflow specifically for building and pushing Docker images to the Forgejo Docker Registry, triggered by pushes to the 'docker' branch. This addition aims to streamline Docker image management and deployment within Forgejo's infrastructure, ensuring a more isolated and secure handling of images. Concurrently, the existing workflow for Docker Hub has been refined to clarify its purpose: it is now explicitly focused on pushing to Docker Hub, removing the overlap with Forgejo Docker Registry operations. This delineation enhances the clarity of our CI/CD processes and ensures a cleaner separation of concerns between public and internal image repositories.
This commit is contained in:
parent
5bc6344fdf
commit
fc26f4b591
2 changed files with 36 additions and 15 deletions
34
.forgejo/workflows/docker-internal.yml
Normal file
34
.forgejo/workflows/docker-internal.yml
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Docker CI/CD Internal
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "docker"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Docker Build and Push to Forgejo Docker Registry
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt update
|
||||
apt install -y docker.io
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to Forgejo Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.private.coffee
|
||||
username: ${{ env.GITHUB_ACTOR }}
|
||||
password: ${{ env.GITHUB_TOKEN }}
|
||||
- name: Build and push to Forgejo Docker Registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
git.private.coffee/privatecoffee/matrix-gptbot:latest
|
||||
git.private.coffee/privatecoffee/matrix-gptbot:${{ env.GITHUB_SHA }}
|
|
@ -1,4 +1,4 @@
|
|||
name: Docker CI/CD
|
||||
name: Docker CI/CD External
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -7,7 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
docker:
|
||||
name: Docker Build and Push
|
||||
name: Docker Build and Push to Docker Hub
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
steps:
|
||||
|
@ -31,16 +31,3 @@ jobs:
|
|||
tags: |
|
||||
kumitterer/matrix-gptbot:latest
|
||||
kumitterer/matrix-gptbot:${{ env.GITHUB_SHA }}
|
||||
- name: Log in to Forgejo Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.private.coffee
|
||||
username: ${{ env.GITHUB_ACTOR }}
|
||||
password: ${{ env.GITHUB_TOKEN }}
|
||||
- name: Build and push to Forgejo Docker Registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
git.private.coffee/privatecoffee/matrix-gptbot:latest
|
||||
git.private.coffee/privatecoffee/matrix-gptbot:${{ env.GITHUB_SHA }}
|
||||
|
|
Loading…
Reference in a new issue