diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 2fb9e92..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 @@ -45,6 +46,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,28 +55,20 @@ 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 }} - mkdir dist + 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.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" - 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]"