From 6cb0d053df43b9830f2e2983497a02e4c011fbc9 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Fri, 6 Mar 2026 11:45:14 -0800 Subject: [PATCH] create ghrc action --- .gitea/workflows/docker-publish-ghcr.yaml | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .gitea/workflows/docker-publish-ghcr.yaml diff --git a/.gitea/workflows/docker-publish-ghcr.yaml b/.gitea/workflows/docker-publish-ghcr.yaml new file mode 100644 index 0000000..611d082 --- /dev/null +++ b/.gitea/workflows/docker-publish-ghcr.yaml @@ -0,0 +1,54 @@ +name: Docker Publish GHCR + +on: + workflow_call: + inputs: + repository: + required: true + type: string + ref: + required: true + type: string + image_name: + required: true + type: string + +jobs: + docker: + runs-on: ubuntu-22.04 + steps: + - name: Echo test + run: echo "${{ inputs.image_name }}" + + - name: Checkout Code to Build + uses: actions/checkout@v4 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + token: ${{ github.token }} + + - name: Load Infisical Secrets + uses: martin/chromart-gitea-actions/.gitea/actions/infisical-secrets@main + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: martindmtrv + # The Infisical secrets action needs to provide a secret named GHCR_PAT + password: ${{ env.GHCR_PAT }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + # image_name should be formatted like: user/repo + images: ghcr.io/${{ inputs.image_name }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}