From 8742333dd3f04f09748b255e325debf34391c825 Mon Sep 17 00:00:00 2001 From: jhot Date: Fri, 15 Sep 2023 12:06:34 -0600 Subject: [PATCH 1/8] Initial workflow --- .forgejo/workflows/build.yaml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .forgejo/workflows/build.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..325d3a5 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,42 @@ +on: + push: + branches: + - main + tags: + - v[0-9]* + pull_request: + branches: + - main + +jobs: + build_and_test: + runs_on: docker + steps: + - name: Checkout + uses: https://code.forgejo.org/actions/checkout@v4 + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Docker metadata + id: meta + uses: https://github.com/docker/metadata-action@v5 + with: + images: name/app + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: https://github.com/docker/login-action@v3 + with: + registry: code.jhot.me + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} -- 2.40.1 From 49b0624084d6e2e45919993a3855e7a2efe47516 Mon Sep 17 00:00:00 2001 From: jhot Date: Fri, 15 Sep 2023 12:21:47 -0600 Subject: [PATCH 2/8] Checkout v3 --- .forgejo/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 325d3a5..cebb02f 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: runs_on: docker steps: - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 + uses: https://code.forgejo.org/actions/checkout@v3 - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v3 - name: Docker metadata -- 2.40.1 From 5b00e2f10a97750f2e4dc4734021abfa0a27bbfb Mon Sep 17 00:00:00 2001 From: jhot Date: Fri, 15 Sep 2023 12:25:50 -0600 Subject: [PATCH 3/8] Docker action versions --- .forgejo/workflows/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index cebb02f..214f5a1 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -15,10 +15,10 @@ jobs: - name: Checkout uses: https://code.forgejo.org/actions/checkout@v3 - name: Set up Docker Buildx - uses: https://github.com/docker/setup-buildx-action@v3 + uses: https://github.com/docker/setup-buildx-action@v2.10.0 - name: Docker metadata id: meta - uses: https://github.com/docker/metadata-action@v5 + uses: https://github.com/docker/metadata-action@v4.6.0 with: images: name/app tags: | @@ -28,13 +28,13 @@ jobs: type=semver,pattern={{major}}.{{minor}} - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: https://github.com/docker/login-action@v3 + uses: https://github.com/docker/login-action@v2.2.0 with: registry: code.jhot.me username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v4.2.1 with: context: . push: ${{ github.event_name != 'pull_request' }} -- 2.40.1 From 2addf2a507e4dd1ed3fe37daafbe84dfd56a4080 Mon Sep 17 00:00:00 2001 From: jhot Date: Fri, 15 Sep 2023 12:45:54 -0600 Subject: [PATCH 4/8] Try dind enpoint --- .forgejo/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 214f5a1..d3e6e0e 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -16,6 +16,8 @@ jobs: uses: https://code.forgejo.org/actions/checkout@v3 - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v2.10.0 + with: + endpoint: tcp://dind:2375 - name: Docker metadata id: meta uses: https://github.com/docker/metadata-action@v4.6.0 -- 2.40.1 From 0523388e041a8aced0ed3f70447e1d9e344c75e9 Mon Sep 17 00:00:00 2001 From: jhot Date: Fri, 15 Sep 2023 13:05:10 -0600 Subject: [PATCH 5/8] Try localhost --- .forgejo/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index d3e6e0e..05658a6 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -17,7 +17,7 @@ jobs: - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v2.10.0 with: - endpoint: tcp://dind:2375 + endpoint: tcp://127.0.0.1:2375 - name: Docker metadata id: meta uses: https://github.com/docker/metadata-action@v4.6.0 -- 2.40.1 From a083f65e11ad0f4d58af449395c11d3c48bd18e5 Mon Sep 17 00:00:00 2001 From: jhot Date: Mon, 18 Sep 2023 16:11:00 -0600 Subject: [PATCH 6/8] Remove docker endpoint --- .forgejo/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 05658a6..214f5a1 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -16,8 +16,6 @@ jobs: uses: https://code.forgejo.org/actions/checkout@v3 - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v2.10.0 - with: - endpoint: tcp://127.0.0.1:2375 - name: Docker metadata id: meta uses: https://github.com/docker/metadata-action@v4.6.0 -- 2.40.1 From 3e4d69c489e1d8ac53fa9344aa5a9d42ee5bf49f Mon Sep 17 00:00:00 2001 From: jhot Date: Tue, 19 Sep 2023 10:52:15 -0600 Subject: [PATCH 7/8] Specify docker endpoint again --- .forgejo/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 214f5a1..7683874 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -16,6 +16,8 @@ jobs: uses: https://code.forgejo.org/actions/checkout@v3 - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v2.10.0 + with: + endpoint: tcp://192.168.0.5:2375 - name: Docker metadata id: meta uses: https://github.com/docker/metadata-action@v4.6.0 -- 2.40.1 From 50bc0f262db8a3770ffdfcd5f80c5a330dae778d Mon Sep 17 00:00:00 2001 From: jhot Date: Tue, 19 Sep 2023 10:55:48 -0600 Subject: [PATCH 8/8] platforms --- .forgejo/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 7683874..a7dd964 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -39,6 +39,9 @@ jobs: uses: docker/build-push-action@v4.2.1 with: context: . + platforms: + - linux/amd64 + - linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} -- 2.40.1