diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 00000000..08bb5254 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,32 @@ +name: Publish Docker image + +on: + push: + branches: + - 'main' + tags: + - '*' + +env: + docker_image_version: ${{ github.ref == 'refs/heads/main' && 'edge' || github.ref_name }} + +jobs: + push_to_registry: + name: Push Docker image to GitHub Container Registry + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build the Docker image + run: make docker-image VERSION=${{ env.docker_image_version }} + + - name: Push the Docker image to GHCR + run: docker push ghcr.io/probesys/bileto:${{ env.docker_image_version }}