diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml new file mode 100644 index 0000000..122a162 --- /dev/null +++ b/.gitea/workflows/docker-publish.yml @@ -0,0 +1,47 @@ +name: docker-publish + +# Build + push des images Docker (web, api) vers Docker Hub uniquement. +# Pas de déploiement ici. + +on: + push: + branches: [main] + paths: + - "web/**" + - "control-plane/api/**" + - ".gitea/workflows/docker-publish.yml" + workflow_dispatch: {} + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build & push web + uses: docker/build-push-action@v6 + with: + context: ./web + file: ./web/Dockerfile + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/omnex-web:latest + + - name: Build & push api + uses: docker/build-push-action@v6 + with: + context: ./control-plane/api + file: ./control-plane/api/Dockerfile + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/omnex-api:latest