diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..8efa9ba --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,24 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: GHCR login + env: + GHCR_USERNAME: ${{ github.actor }} + GHCR_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: echo "${GHCR_TOKEN}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin + - name: Build the Docker image + run: | + GHCR_IMAGE=ghcr.io/grycap/oscar-metrics + + docker build . --file Dockerfile --output "type=image,push=true" --tag ${GHCR_IMAGE}:latest