diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..9c6e628 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,24 @@ +name: Build and Push Docker Image + +on: + push: + branches: [main] + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Build the Docker Image + run: | + docker build \ + -t sprout-db-migrations:latest \ + -t sprout-db-migrations:$(git rev-parse --short) \ + -f Dockerfile \ + . + + - name: Login to Container Registry + run: echo "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin ${{ secrets.DOCKER_REGISTRY }} + + - name: Push the Docker Image + run: docker push ${{ secrets.DOCKER_REGISTRY }}/sprout-db-migrations:$(git rev-parse --short)