summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaz <ndpm13@ch-naseem.com>2025-09-15 20:37:45 +0100
committerNaz <ndpm13@ch-naseem.com>2025-09-15 21:17:07 +0100
commit622efeecab084c0a036be83def306b9c19f6e7e8 (patch)
tree4a4005e9d62366ccda7ff053e2b55c1b9a68631d
parent40c360c9f06445f97278f34f6ecee3360ecfaa19 (diff)
🔄ci: add build & publish container workflow
-rw-r--r--.github/workflows/build-publish-container-image.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/.github/workflows/build-publish-container-image.yml b/.github/workflows/build-publish-container-image.yml
new file mode 100644
index 0000000..279e065
--- /dev/null
+++ b/.github/workflows/build-publish-container-image.yml
@@ -0,0 +1,33 @@
+name: Build & Publish Container
+
+on:
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: "Build tag"
+ required: true
+ default: "latest"
+ type: string
+
+jobs:
+ build_publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Build the container image
+ run: |
+ docker build . --file Containerfile --tag ${{ github.repository }}:${{ github.event.inputs.tag }}
+ docker tag ${{ github.repository }}:${{ github.event.inputs.tag }} git.ch-naseem.com/${{ github.repository }}:${{ github.event.inputs.tag }}
+ docker tag ${{ github.repository }}:${{ github.event.inputs.tag }} ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}
+
+ - name: Publish the image to Docker Hub
+ run: |
+ echo "${{ secrets.FORGEJO_TOKEN }}" | docker login git.ch-naseem.com -u ${{ github.actor }} --password-stdin
+ docker push git.ch-naseem.com/${{ github.repository }}:${{ github.event.inputs.tag }}
+
+ - name: Publish the image to Github Container Registry
+ run: |
+ echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+ docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}