From 8470ccfea712c63de17caaf12867281c95dddd95 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 24 May 2021 10:05:01 +0700 Subject: [PATCH 1/5] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 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..7f1ea7f --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build src/ --file src/Dockerfile --tag https://ghcr.io/neothor/steam-openid-connect-provider:$(date +%s) From a5988b792a5adb82143347eab56984efa2ea963c Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 24 May 2021 10:06:40 +0700 Subject: [PATCH 2/5] Encapsulate tag --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7f1ea7f..336caf0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: docker build src/ --file src/Dockerfile --tag https://ghcr.io/neothor/steam-openid-connect-provider:$(date +%s) + run: docker build src/ --file src/Dockerfile --tag "https://ghcr.io/neothor/steam-openid-connect-provider:$(date +%s)" From d6fd51cb560612620b7c938983ca1f85ce53f98d Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 24 May 2021 10:07:38 +0700 Subject: [PATCH 3/5] No proto --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 336caf0..81d25a6 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: docker build src/ --file src/Dockerfile --tag "https://ghcr.io/neothor/steam-openid-connect-provider:$(date +%s)" + run: docker build src/ --file src/Dockerfile --tag "ghcr.io/neothor/steam-openid-connect-provider:$(date +%s)" From a3f58dc59b1dc4f7ce8e946c62e21e0d4ad7b5a9 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 24 May 2021 10:16:53 +0700 Subject: [PATCH 4/5] =?UTF-8?q?Login=20into=20GitHub=20and=20push=20?= =?UTF-8?q?=F0=9F=A4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 81d25a6..7a12067 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,6 +13,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: docker build src/ --file src/Dockerfile --tag "ghcr.io/neothor/steam-openid-connect-provider:$(date +%s)" + - + name: Checkout + uses: actions/checkout@v2 + + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: src/ + push: true + tags: ghcr.io/neothor/steam-openid-connect-provider:$(date +%s) From 01bf36c992aea8fee26395fa31b57a05661dcb94 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 24 May 2021 10:20:29 +0700 Subject: [PATCH 5/5] Create tags --- .github/workflows/docker-image.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7a12067..3e3a97d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,10 +25,27 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - + name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + ghcr.io/neothor/steam-openid-connect-provider + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push uses: docker/build-push-action@v2 with: context: src/ - push: true - tags: ghcr.io/neothor/steam-openid-connect-provider:$(date +%s) + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}