From da9555c76ee75ab9ee85ddce8911d966550b4b80 Mon Sep 17 00:00:00 2001 From: Sithum Bopitiya Date: Sat, 13 Apr 2024 14:12:33 +0530 Subject: [PATCH 1/4] Set html file --- .github/workflows/unstable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 2fb9e92..56b2298 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -67,13 +67,13 @@ jobs: mkdir dist sed -e "s#linux-download-href#$LINUX_DOWNLOAD_HREF#g" \ -e "s#linux-download#$LINUX_DOWNLOAD#g" \ - index.html.tmp > dist/index.html + index.html - name: Push generated webpage to another repository uses: cpina/github-action-push-to-another-repository@main env: API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} with: - source-directory: "dist" + source-directory: "." destination-github-username: "sithumonline" destination-repository-name: "json_x_preview" user-email: "github-actions[bot]@users.noreply.github.com" From 4b6b62c00296cb235db48fb9f1490e50b299cc95 Mon Sep 17 00:00:00 2001 From: Sithum Bopitiya Date: Sat, 13 Apr 2024 14:17:23 +0530 Subject: [PATCH 2/4] Rm dist --- .github/workflows/unstable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 56b2298..2ef4d5a 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -64,7 +64,6 @@ jobs: run: | export LINUX_DOWNLOAD_HREF=${{ needs.unstable-linux.outputs.artifact_link }} export LINUX_DOWNLOAD=json_x_glfw_opengl3-linux-amd64_unstable_${{ env.SHA_SHORT }} - mkdir dist sed -e "s#linux-download-href#$LINUX_DOWNLOAD_HREF#g" \ -e "s#linux-download#$LINUX_DOWNLOAD#g" \ index.html From 15df7fb53aa2182a99334be2ac750cde9242161c Mon Sep 17 00:00:00 2001 From: Sithum Bopitiya Date: Sat, 13 Apr 2024 14:35:50 +0530 Subject: [PATCH 3/4] Rm step to get the sha --- .github/workflows/unstable.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 2ef4d5a..4eb6e91 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -45,6 +45,7 @@ jobs: id: generate-artifact-link run: | echo "artifact_link=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }}" >> "$GITHUB_OUTPUT" + echo "sha_short=${{ env.SHA_SHORT }}" >> "$GITHUB_OUTPUT" web-build: name: Web page build @@ -53,17 +54,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set commit hash - run: | - echo "SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" - - name: Checkout to web branch - uses: actions/checkout@v2 - with: - ref: development/web - name: Compile HTML run: | export LINUX_DOWNLOAD_HREF=${{ needs.unstable-linux.outputs.artifact_link }} - export LINUX_DOWNLOAD=json_x_glfw_opengl3-linux-amd64_unstable_${{ env.SHA_SHORT }} + export LINUX_DOWNLOAD=json_x_glfw_opengl3-linux-amd64_unstable_${{ needs.unstable-linux.outputs.sha_short }} sed -e "s#linux-download-href#$LINUX_DOWNLOAD_HREF#g" \ -e "s#linux-download#$LINUX_DOWNLOAD#g" \ index.html From 7ce375b62620e003b79d97822452408f1b2e0a20 Mon Sep 17 00:00:00 2001 From: Sithum Bopitiya Date: Sat, 13 Apr 2024 15:27:17 +0530 Subject: [PATCH 4/4] Fix sha short --- .github/workflows/unstable.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 4eb6e91..5b58aca 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest outputs: artifact_link: ${{ steps.generate-artifact-link.outputs.artifact_link }} + sha_short: ${{ steps.generate-artifact-link.outputs.sha_short }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -69,5 +70,5 @@ jobs: source-directory: "." destination-github-username: "sithumonline" destination-repository-name: "json_x_preview" - user-email: "github-actions[bot]@users.noreply.github.com" - user-name: "github-actions[bot]" + user-email: "${{ needs.unstable-linux.outputs.sha_short }}+github-actions[bot]@users.noreply.github.com" + user-name: "${{ needs.unstable-linux.outputs.sha_short }}+github-actions[bot]"