From be9790cd768ad32aacbddb6493c750ca9d7b5e0a Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Fri, 13 Aug 2021 08:45:33 +0100 Subject: [PATCH 1/6] Automatically build and publish to Github Container Registry --- .github/workflows/container_build.yml | 74 +++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/container_build.yml diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml new file mode 100644 index 000000000..74b2d73f0 --- /dev/null +++ b/.github/workflows/container_build.yml @@ -0,0 +1,74 @@ +# This is a basic workflow to help you get started with Actions + +name: Build and deploy containers + +# Controls when the action will run. +on: + push: + branches: + - 'main' + pull_request: + branches: + - main + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + - name: Check Out Repo + uses: actions/checkout@v2 + + - + name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/louislam/uptim-kuma + # generate Docker tags based on the following events/attributes + 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 + type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./dockerfile + push: true + platforms: linux/amd64, linux/arm/v7, linux/arm/v6, linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From f14e9df0203e61b039a6e2d2d398c50cbcf5eb00 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Fri, 27 Aug 2021 19:12:14 +0100 Subject: [PATCH 2/6] Update the container name to the correct value --- .github/workflows/container_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index 74b2d73f0..4681fe133 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -31,7 +31,7 @@ jobs: with: # list of Docker images to use as base name for tags images: | - ghcr.io/louislam/uptim-kuma + ghcr.io/louislam/uptime-kuma # generate Docker tags based on the following events/attributes tags: | type=schedule From cd5ff2c45914b9a37ab0a606230e7a118be06265 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Wed, 13 Oct 2021 13:47:08 +0100 Subject: [PATCH 3/6] Update changes to use master rather than main --- .github/workflows/container_build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index 4681fe133..3cb59caef 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -6,10 +6,10 @@ name: Build and deploy containers on: push: branches: - - 'main' + - 'master' pull_request: branches: - - main + - master # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -41,7 +41,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha - type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }} + type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} - name: Login to Docker Hub uses: docker/login-action@v1 From 0ed5453d04ca614838eafce9d6109d45e38a7079 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Wed, 13 Oct 2021 13:50:04 +0100 Subject: [PATCH 4/6] Use correct case for Dockerfile --- .github/workflows/container_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index 3cb59caef..1b970809f 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -64,7 +64,7 @@ jobs: uses: docker/build-push-action@v2 with: context: ./ - file: ./dockerfile + file: ./Dockerfile push: true platforms: linux/amd64, linux/arm/v7, linux/arm/v6, linux/arm64 tags: ${{ steps.meta.outputs.tags }} From 69a28c5e60881ed7be845b39c3c8c98124797f91 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Wed, 13 Oct 2021 13:50:55 +0100 Subject: [PATCH 5/6] Dockerfile has been moved, updating path --- .github/workflows/container_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index 1b970809f..869ca1981 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -64,7 +64,7 @@ jobs: uses: docker/build-push-action@v2 with: context: ./ - file: ./Dockerfile + file: ./docker/dockerfile push: true platforms: linux/amd64, linux/arm/v7, linux/arm/v6, linux/arm64 tags: ${{ steps.meta.outputs.tags }} From f6f1fe9c9d54b67940157455e92ee1d6993cf0d0 Mon Sep 17 00:00:00 2001 From: Matthew Macdonald-Wallace Date: Thu, 12 May 2022 09:51:52 +0100 Subject: [PATCH 6/6] fix formatting issue Co-authored-by: Adam Stachowicz --- .github/workflows/container_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index 869ca1981..20f182bd9 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -24,8 +24,7 @@ jobs: - name: Check Out Repo uses: actions/checkout@v2 - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v3 with: