From 0862a8bab6b43936d3c36b3638860a812142c55b Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 10:40:53 +0100 Subject: [PATCH 1/8] Generate navitia docs --- .../publish_navitia_documentation.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index d55a72b4cb..abd516ab4c 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -2,9 +2,9 @@ name: Publish Navitia Documentation on: push: - branches: - - release - workflow_dispatch: + tags: + - '*' + pull_request: env: REGION: eu-west-1 @@ -30,14 +30,14 @@ jobs: # copy website to workspace rm -rf /work/documentation/slate/build cp -r /srv/slate/build /work/documentation/slate - - name: Deploy to GitHub Pages - if: success() - uses: crazy-max/ghaction-github-pages@v2 - with: - target_branch: gh-pages - build_dir: documentation/slate/build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Deploy to GitHub Pages + # if: success() + # uses: crazy-max/ghaction-github-pages@v2 + # with: + # target_branch: gh-pages + # build_dir: documentation/slate/build + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: slack notification (the job has failed) if: failure() run: | From 9e77ca8198205c8e14781f933f90d3d4ecd2e7f8 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:02:32 +0100 Subject: [PATCH 2/8] test --- .github/workflows/publish_navitia_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index abd516ab4c..fb759e0533 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -22,6 +22,7 @@ jobs: - name: Build website in Slate format uses: addnab/docker-run-action@v3 with: + username: $USER image: slatedocs/slate:latest options: -v ${{ github.workspace }}:/work run: | From 9d3a44fae4961faa1e42ffc011de6551cc241397 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:13:11 +0100 Subject: [PATCH 3/8] Add chown --- .github/workflows/publish_navitia_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index fb759e0533..dea759f0da 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -26,6 +26,7 @@ jobs: image: slatedocs/slate:latest options: -v ${{ github.workspace }}:/work run: | + chown -R $USER:$USER /work cp -r /work/documentation/slate/source /srv/slate ./slate.sh build # copy website to workspace From de37d31c3727e6e09bb18e0dae25da8909b4b152 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:25:43 +0100 Subject: [PATCH 4/8] Add --user --- .github/workflows/publish_navitia_documentation.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index dea759f0da..a4126a5652 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -22,11 +22,9 @@ jobs: - name: Build website in Slate format uses: addnab/docker-run-action@v3 with: - username: $USER image: slatedocs/slate:latest - options: -v ${{ github.workspace }}:/work + options: -v ${{ github.workspace }}:/work --user $(id -u):$(id -g) run: | - chown -R $USER:$USER /work cp -r /work/documentation/slate/source /srv/slate ./slate.sh build # copy website to workspace From 32cb430fb4e178dd34733a5940d4f7fc8b6d138c Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:29:17 +0100 Subject: [PATCH 5/8] correction --- .github/workflows/publish_navitia_documentation.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index a4126a5652..4b67b1309e 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -23,7 +23,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: slatedocs/slate:latest - options: -v ${{ github.workspace }}:/work --user $(id -u):$(id -g) + options: -v ${{ github.workspace }}:/work run: | cp -r /work/documentation/slate/source /srv/slate ./slate.sh build @@ -43,8 +43,8 @@ jobs: run: | echo '{"text":":warning: Navitia Github Actions: publish_navitia_documentation failed ! (https://github.com/hove-io/navitia/actions?query=workflow%3A%22Publish+Navitia+Documentation%22)"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}} - - name: clean up workspace - if: ${{ always() }} - run: | - rm -rf ./* - rm -rf ./.??* \ No newline at end of file + # - name: clean up workspace + # if: ${{ always() }} + # run: | + # rm -rf ./* + # rm -rf ./.??* \ No newline at end of file From 05b3af257e314b98f745e23f8d8348246886fa3e Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:40:35 +0100 Subject: [PATCH 6/8] publish docs --- .../publish_navitia_documentation.yml | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index 4b67b1309e..3f53d7a3fb 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -15,6 +15,14 @@ jobs: steps: - name: force chown to avoid errors run: chown -R $USER:$USER . + + - name: Generate github private access token + id: ci-core-app-token + uses: getsentry/action-github-app-token@v2.0.0 + with: + app_id: ${{ secrets.CI_CORE_APP_ID }} + private_key: ${{ secrets.CI_CORE_APP_PEM }} + - name: Git config run: git config --global --add safe.directory /__w/navitia/navitia - name: Checkout @@ -30,14 +38,15 @@ jobs: # copy website to workspace rm -rf /work/documentation/slate/build cp -r /srv/slate/build /work/documentation/slate - # - name: Deploy to GitHub Pages - # if: success() - # uses: crazy-max/ghaction-github-pages@v2 - # with: - # target_branch: gh-pages - # build_dir: documentation/slate/build - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy to GitHub Pages + if: success() + uses: crazy-max/ghaction-github-pages@v2 + with: + target_branch: gh-pages + build_dir: documentation/slate/build + env: + GITHUB_TOKEN: ${{ steps.ci-core-app-token.outputs.token }} + - name: slack notification (the job has failed) if: failure() run: | From 88aa50b6a631b497256bdd7fa9eb40794e2bbc13 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:48:32 +0100 Subject: [PATCH 7/8] push with tocken --- .github/workflows/publish_navitia_documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index 3f53d7a3fb..c45711fbeb 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -45,7 +45,7 @@ jobs: target_branch: gh-pages build_dir: documentation/slate/build env: - GITHUB_TOKEN: ${{ steps.ci-core-app-token.outputs.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: slack notification (the job has failed) if: failure() From df602ffb023a0503e2b5a9932eea200997e04876 Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Fri, 7 Mar 2025 11:53:02 +0100 Subject: [PATCH 8/8] Launch job on tags --- .../workflows/publish_navitia_documentation.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/publish_navitia_documentation.yml b/.github/workflows/publish_navitia_documentation.yml index c45711fbeb..c8159bc92e 100644 --- a/.github/workflows/publish_navitia_documentation.yml +++ b/.github/workflows/publish_navitia_documentation.yml @@ -4,7 +4,6 @@ on: push: tags: - '*' - pull_request: env: REGION: eu-west-1 @@ -16,13 +15,6 @@ jobs: - name: force chown to avoid errors run: chown -R $USER:$USER . - - name: Generate github private access token - id: ci-core-app-token - uses: getsentry/action-github-app-token@v2.0.0 - with: - app_id: ${{ secrets.CI_CORE_APP_ID }} - private_key: ${{ secrets.CI_CORE_APP_PEM }} - - name: Git config run: git config --global --add safe.directory /__w/navitia/navitia - name: Checkout @@ -51,9 +43,3 @@ jobs: if: failure() run: | echo '{"text":":warning: Navitia Github Actions: publish_navitia_documentation failed ! (https://github.com/hove-io/navitia/actions?query=workflow%3A%22Publish+Navitia+Documentation%22)"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}} - - # - name: clean up workspace - # if: ${{ always() }} - # run: | - # rm -rf ./* - # rm -rf ./.??* \ No newline at end of file