From 2cba2bf7a83d73e3c13cd73c5d181df0fa6a35d7 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:26:33 +0200 Subject: [PATCH 01/15] Pasting default content of https://github.com/googleapis/release-please-action --- .github/workflows/release-please.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c7e1f40 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +on: + push: + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: simple \ No newline at end of file From 370583ad83d2dfb2ffade2158b64c13db12605a8 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:27:16 +0200 Subject: [PATCH 02/15] Making dummy commit to see how Github react --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c7e1f40..52a640c 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -15,4 +15,4 @@ jobs: with: # this is a built-in strategy in release-please, see "Action Inputs" # for more options - release-type: simple \ No newline at end of file + release-type: simple From e651ceaa54571791785836971872505c906c2335 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:31:03 +0200 Subject: [PATCH 03/15] Adding PAT --- .github/workflows/release-please.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 52a640c..0acb3ef 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -13,6 +13,10 @@ jobs: steps: - uses: googleapis/release-please-action@v4 with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.PAT }} # this is a built-in strategy in release-please, see "Action Inputs" # for more options release-type: simple From 09556385ff5398bebddfa0489d5bd734d0d7c50c Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:37:16 +0200 Subject: [PATCH 04/15] Changing source of tutorial to https://github.com/docker/metadata-action --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 22 --------------- 2 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..125c867 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: ci + +on: + workflow_dispatch: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: name/app + - + name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.PAT }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 0acb3ef..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - push: - -permissions: - contents: write - pull-requests: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@v4 - with: - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). - token: ${{ secrets.PAT }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options - release-type: simple From ff827ff9fccd680beb34b553531975bb01c6d319 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:38:42 +0200 Subject: [PATCH 05/15] Markitdown use 'main' as the master branch --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 125c867..314ee6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,12 +4,12 @@ on: workflow_dispatch: push: branches: - - 'master' + - 'main' tags: - '*' pull_request: branches: - - 'master' + - 'main' jobs: docker: From e63cf80653c2b941bf8036a5d0b4a6b926a4c06f Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:44:17 +0200 Subject: [PATCH 06/15] Using container repository defined on the Github settings --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 314ee6e..3f5bb6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.PAT }} - From 493197caebd1f6f9c585bc164ec8d8f7cbb51cbe Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:44:58 +0200 Subject: [PATCH 07/15] For testing purposes, we are making a container on each push --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f5bb6d..60481d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,15 @@ name: ci on: - workflow_dispatch: + #workflow_dispatch: push: - branches: - - 'main' - tags: - - '*' - pull_request: - branches: - - 'main' + # branches: + # - 'main' + # tags: + # - '*' + #pull_request: + # branches: + # - 'main' jobs: docker: From feba8a0a4af081f7b1f230e7c31edf0be07cb613 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 01:47:01 +0200 Subject: [PATCH 08/15] the CI did not try to push on ghcr.io but on docker.io ; trying to make the variable hardcoded --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60481d3..d60c870 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.PAT }} - From 6e693eb0deb7e5a2651fe966dc3f525b21261a72 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 13:27:27 +0200 Subject: [PATCH 09/15] Looking at the logs, it's due to the image which was hard codded --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d60c870..a13f335 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: name/app + images: ${{ github.repository }} - name: Login to DockerHub if: github.event_name != 'pull_request' From dd64b4f8e73f68b6b0ced98b1b5d8a744d3ddfe4 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 13:43:46 +0200 Subject: [PATCH 10/15] Looking at the logs, the PAT has insufficient rights ; gonna try the default PAT --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a13f335..4df4051 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.PAT }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 From 4f3d4e406cf53349b1147b03d7a4ac7c859dc6ff Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 13:48:05 +0200 Subject: [PATCH 11/15] I pointed a few things out to a LLM and this was proposed ; i don't really like to hardcode it but for testing purposes i'm gonna try --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4df4051..c1b166f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ github.repository }} + images: ghcr.io/${{ github.repository }} - name: Login to DockerHub if: github.event_name != 'pull_request' From 3f6a90641233f4974a727345edb75e470a1cb750 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 13:51:52 +0200 Subject: [PATCH 12/15] This worked out pretty well ; gonna try to put the repo in an environment variable --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1b166f..2b717d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,13 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/${{ github.repository }} + images: ${{ env.REGISTRY }}/${{ github.repository }} - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - From 5caecac3cf70ec28a761989d22ea90d6512173a9 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 14:00:02 +0200 Subject: [PATCH 13/15] The registry is not in the environment context, but in the variable context here --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b717d5..aea8102 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,13 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ github.repository }} + images: ${{ vars.REGISTRY }}/${{ github.repository }} - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ${{ vars.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - From d00becd6a91edbe36f0b199d611bc3547930ae5a Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 14:25:54 +0200 Subject: [PATCH 14/15] We're gonna create a container only on tag creation --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aea8102..df76d79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,10 @@ name: ci on: #workflow_dispatch: push: - # branches: - # - 'main' - # tags: - # - '*' + #branches: + # - 'main' + tags: + - '*' #pull_request: # branches: # - 'main' From ad315b896274562f78b7fd531c6b15aa82ce3366 Mon Sep 17 00:00:00 2001 From: Goulven Bourveau Date: Sat, 12 Apr 2025 14:33:08 +0200 Subject: [PATCH 15/15] Cleaning up --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df76d79..8bba2dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,9 @@ name: ci on: - #workflow_dispatch: push: - #branches: - # - 'main' tags: - '*' - #pull_request: - # branches: - # - 'main' jobs: docker: