From d86329ed9a4b1034f4c042f5bd063a8ea04b55ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 4 Sep 2024 15:35:37 +0200 Subject: [PATCH] Add new workflow for building Docker image This commit introduces a new GitHub Actions workflow used to build and push Docker images upon every push. This workflow uses Docker Buildx and automatically logs into the specified registry with stored credentials. --- .gitea/workflows/build-image.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitea/workflows/build-image.yaml diff --git a/.gitea/workflows/build-image.yaml b/.gitea/workflows/build-image.yaml new file mode 100644 index 0000000..9437732 --- /dev/null +++ b/.gitea/workflows/build-image.yaml @@ -0,0 +1,31 @@ +name: Build image and push it to registry + +on: + push + + +jobs: + # Build job + build: + runs-on: cth-ubuntu-latest + steps: + - name: Check out repository + uses: https://github.com/actions/checkout@v4 + + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + + - name: Login to registry + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: 'h3m6q87t.gra7.container-registry.ovh.net' + + - name: Build and push + uses: https://github.com/docker/build-push-action@v5 + with: + context: ./pythonProject + file: ./pythonProject/Dockerfile + push: true + tags: 'h3m6q87t.gra7.container-registry.ovh.net/sign-pdf-worker/worker:latest' \ No newline at end of file