From 7ee087a79c5dcdf13e1769ad315702cb6435f966 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 15 Sep 2025 20:37:45 +0100 Subject: =?UTF-8?q?=F0=9F=94=84ci:=20add=20build=20&=20publish=20container?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/build-publish-container-image.yml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build-publish-container-image.yml (limited to '.github/workflows') diff --git a/.github/workflows/build-publish-container-image.yml b/.github/workflows/build-publish-container-image.yml new file mode 100644 index 0000000..8da4896 --- /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 Forgejo + 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 }} -- cgit v1.2.3