From 6567019e92e68fd378c6f1a7d525295334a4eb92 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:24:29 +0200 Subject: [PATCH 1/9] Adapted docker.yml --- .github/workflows/docker.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cd1143d455e..f2a10f265c3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,6 +22,7 @@ jobs: - name: Check out uses: actions/checkout@v4 + path: etherpad - name: Set up QEMU if: github.event_name == 'push' @@ -62,6 +63,7 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Test + path: etherpad run: | docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }} ./bin/installDeps.sh @@ -82,6 +84,7 @@ jobs: if: github.event_name == 'push' id: meta uses: docker/metadata-action@v5 + path: etherpad with: images: etherpad/etherpad tags: | @@ -92,6 +95,7 @@ jobs: - name: Log in to Docker Hub if: github.event_name == 'push' + path: etherpad uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -99,6 +103,7 @@ jobs: - name: Build and push if: github.event_name == 'push' + path: etherpad uses: docker/build-push-action@v6 with: context: . @@ -109,9 +114,30 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Update repo description uses: peter-evans/dockerhub-description@v4 + path: etherpad if: github.ref == 'refs/heads/master' with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: etherpad/etherpad enable-url-completion: true + - name: Check out + uses: actions/checkout@v4 + path: ether-charts + with: + repository: https://github.com/ether/ether-charts + token: ${{ secrets.GITHUB_TOKEN }} + - name: Update tag in values-dev.yaml + #if: github.event == 'push' && github.ref == 'refs/heads/develop' + path: ether-charts + run: | + sed -i 's/tag: ".*"/tag: "${{ steps.meta.outputs.sha }}"/' values-dev.yaml + - name: Commit and push changes + path: ether-charts + #if: github.event == 'push' && github.ref == 'refs/heads/develop' + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add values-dev.yaml + git commit -m 'Update develop image tag' + git push From 2d4d7bbc07a1add96b130cf0ac4f254c0c5e56ac Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:26:09 +0200 Subject: [PATCH 2/9] Also run on feature branch --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f2a10f265c3..9ab71a118eb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,6 +6,7 @@ on: push: branches: - 'develop' + - 'feature/update-tag-on-push' paths-ignore: - 'doc/**' tags: From f5e3888e2bb2b3043d64cbfbcf54d4ec9e443095 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+SamTV12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:33:23 +0200 Subject: [PATCH 3/9] Update docker.yml --- .github/workflows/docker.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9ab71a118eb..8ca7dd1b983 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,7 +23,9 @@ jobs: - name: Check out uses: actions/checkout@v4 - path: etherpad + with: + path: etherpad + - name: Set up QEMU if: github.event_name == 'push' @@ -35,7 +37,7 @@ jobs: name: Build and export to Docker uses: docker/build-push-action@v6 with: - context: . + context: ./etherpad target: production load: true tags: ${{ env.TEST_TAG }} @@ -64,7 +66,7 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Test - path: etherpad + working-directory: etherpad run: | docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }} ./bin/installDeps.sh @@ -85,7 +87,6 @@ jobs: if: github.event_name == 'push' id: meta uses: docker/metadata-action@v5 - path: etherpad with: images: etherpad/etherpad tags: | @@ -96,7 +97,6 @@ jobs: - name: Log in to Docker Hub if: github.event_name == 'push' - path: etherpad uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -104,10 +104,9 @@ jobs: - name: Build and push if: github.event_name == 'push' - path: etherpad uses: docker/build-push-action@v6 with: - context: . + context: ./etherpad target: production platforms: linux/amd64,linux/arm64 push: true @@ -115,26 +114,26 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Update repo description uses: peter-evans/dockerhub-description@v4 - path: etherpad if: github.ref == 'refs/heads/master' with: + readme-filepath: ./etherpad/README.md username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: etherpad/etherpad enable-url-completion: true - name: Check out uses: actions/checkout@v4 - path: ether-charts with: + path: ether-charts repository: https://github.com/ether/ether-charts token: ${{ secrets.GITHUB_TOKEN }} - name: Update tag in values-dev.yaml #if: github.event == 'push' && github.ref == 'refs/heads/develop' - path: ether-charts + working-directory: ether-charts run: | sed -i 's/tag: ".*"/tag: "${{ steps.meta.outputs.sha }}"/' values-dev.yaml - name: Commit and push changes - path: ether-charts + working-directory: ether-charts #if: github.event == 'push' && github.ref == 'refs/heads/develop' run: | git config --global user.name 'github-actions[bot]' From c9be20ccc1e5a56a47f49894049640789466fd1e Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:41:48 +0200 Subject: [PATCH 4/9] Fixed github ref --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8ca7dd1b983..4aabcefbb41 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,9 +23,9 @@ jobs: - name: Check out uses: actions/checkout@v4 - with: + with: path: etherpad - + - name: Set up QEMU if: github.event_name == 'push' @@ -125,7 +125,7 @@ jobs: uses: actions/checkout@v4 with: path: ether-charts - repository: https://github.com/ether/ether-charts + repository: ether/ether-charts token: ${{ secrets.GITHUB_TOKEN }} - name: Update tag in values-dev.yaml #if: github.event == 'push' && github.ref == 'refs/heads/develop' From 8d967658be0ceb1947564e7e0061ab6540f69a02 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:57:12 +0200 Subject: [PATCH 5/9] Add generated token --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4aabcefbb41..bafad6ff343 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -126,7 +126,7 @@ jobs: with: path: ether-charts repository: ether/ether-charts - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ETHER_CHART_TOKEN }} - name: Update tag in values-dev.yaml #if: github.event == 'push' && github.ref == 'refs/heads/develop' working-directory: ether-charts From 4129593fe1dda4a8dffc3f184a9087448e98d84b Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:07:10 +0200 Subject: [PATCH 6/9] Fixed replacing digest --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bafad6ff343..e272bf4361d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -103,6 +103,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push + id: build-docker if: github.event_name == 'push' uses: docker/build-push-action@v6 with: @@ -131,7 +132,7 @@ jobs: #if: github.event == 'push' && github.ref == 'refs/heads/develop' working-directory: ether-charts run: | - sed -i 's/tag: ".*"/tag: "${{ steps.meta.outputs.sha }}"/' values-dev.yaml + sed -i 's/tag: ".*"/tag: "${{ steps.build-docker.outputs.digest }}"/' values-dev.yaml - name: Commit and push changes working-directory: ether-charts #if: github.event == 'push' && github.ref == 'refs/heads/develop' From 01c5bfa4255baa6017d81077aaad92c185375692 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:12:57 +0200 Subject: [PATCH 7/9] Added digest to outputs --- .github/workflows/docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e272bf4361d..601013ed839 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -107,6 +107,8 @@ jobs: if: github.event_name == 'push' uses: docker/build-push-action@v6 with: + outputs: + - digest context: ./etherpad target: production platforms: linux/amd64,linux/arm64 From 6634dcb15c54126fdde6e0bb5df0a2a21c918c8a Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:18:34 +0200 Subject: [PATCH 8/9] Fixed docker run --- .github/workflows/docker.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 601013ed839..b7e6c199e77 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,6 @@ on: push: branches: - 'develop' - - 'feature/update-tag-on-push' paths-ignore: - 'doc/**' tags: @@ -131,13 +130,13 @@ jobs: repository: ether/ether-charts token: ${{ secrets.ETHER_CHART_TOKEN }} - name: Update tag in values-dev.yaml - #if: github.event == 'push' && github.ref == 'refs/heads/develop' + if: github.event == 'push' && github.ref == 'refs/heads/develop' working-directory: ether-charts run: | sed -i 's/tag: ".*"/tag: "${{ steps.build-docker.outputs.digest }}"/' values-dev.yaml - name: Commit and push changes working-directory: ether-charts - #if: github.event == 'push' && github.ref == 'refs/heads/develop' + if: github.event == 'push' && github.ref == 'refs/heads/develop' run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' From 0ec424f7fd6eec662277a05346f0a558099dceb0 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:19:39 +0200 Subject: [PATCH 9/9] Fixed docker run --- .github/workflows/docker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b7e6c199e77..696758579e5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -106,8 +106,6 @@ jobs: if: github.event_name == 'push' uses: docker/build-push-action@v6 with: - outputs: - - digest context: ./etherpad target: production platforms: linux/amd64,linux/arm64