From b4bce5db42364ccd743c6d463a9564df93590b63 Mon Sep 17 00:00:00 2001 From: Jonathan Rampersad Date: Fri, 30 May 2025 12:01:32 -0400 Subject: [PATCH] Added Workflow to upload new docker image on push --- .gitea/workflows/publish-registry.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/publish-registry.yml diff --git a/.gitea/workflows/publish-registry.yml b/.gitea/workflows/publish-registry.yml new file mode 100644 index 0000000..b0ed62d --- /dev/null +++ b/.gitea/workflows/publish-registry.yml @@ -0,0 +1,44 @@ +name: Publish to Package Regsitry + +on: + push: + branches: + - main + +env: + REGISTRY_URL: https://gitea.jono-rams.work + REGISTRY_TOKEN: ${{ secrets.GLOBAL_PACKAGE_TOKEN }} + REGISTRY_USER: ${{ vars.GLOBAL_ACCOUNT_EMAIL }} + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Login to Gitea Package Regsitry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_URL }} + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ env.REGISTRY_URL }}/${{ secrets.GITEA_REPOSITORY_OWNER }}/${{ secrets.GITEA_REPOSITORY_NAME }}:latest + ${{ env.REGISTRY_URL }}/${{ secrets.GITEA_REPOSITORY_OWNER }}/${{ secrets.GITEA_REPOSITORY_NAME }}:${{ github.sha }} + + - name: Logout from Gitea Package Regsitry + if: always() + run: docker logout ${env.REGISTRY_URL} +