From a8b0916c6b88b8bfb511b53900079e54ba592e10 Mon Sep 17 00:00:00 2001 From: Caterina <36919673+catttam@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:50:18 +0200 Subject: [PATCH 1/3] Create docker-image.yml --- .github/workflows/docker-image.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..d1ba4d5 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,16 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag oscar-metrics:$(date +%s) From fe326d3a1f7093bc49392498a8e6a90b52dd66f7 Mon Sep 17 00:00:00 2001 From: Caterina <36919673+catttam@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:04:07 +0200 Subject: [PATCH 2/3] Update docker-image.yml --- .github/workflows/docker-image.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d1ba4d5..ae80de4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,5 +12,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: GHCR login + env: + GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }} + GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }} + run: echo "${GHCR_PASSWORD}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin - name: Build the Docker image - run: docker build . --file Dockerfile --tag oscar-metrics:$(date +%s) + run: | + GHCR_IMAGE=ghcr.io/grycap/oscar-metrics + + docker build . --file Dockerfile --output "type=image,push=true" --tag ${GHCR_IMAGE}:latest From 7f3931d51af88f0dc7975c4de09fd993387914a9 Mon Sep 17 00:00:00 2001 From: Caterina <36919673+catttam@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:22:54 +0200 Subject: [PATCH 3/3] Update docker-image.yml --- .github/workflows/docker-image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ae80de4..8efa9ba 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,9 +14,9 @@ jobs: - uses: actions/checkout@v4 - name: GHCR login env: - GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }} - GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }} - run: echo "${GHCR_PASSWORD}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin + 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