diff --git a/.github/workflows/publish-preview.yml b/.github/workflows/publish-preview.yml new file mode 100644 index 0000000000..949d3032c8 --- /dev/null +++ b/.github/workflows/publish-preview.yml @@ -0,0 +1,45 @@ +name: GitHub Actions build preview + +on: + workflow_run: + workflows: ["Continuous Integration"] + types: + - completed + workflow_dispatch: + +jobs: + deploy: + name: deploy to github action + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Download deployment artifacts + uses: dawidd6/action-download-artifact@v6 + with: + workflow: integration.yml + run_id: ${{ github.event.workflow_run.id }} + name: reposense-deployment + path: . + + - name: Unzip deployment artifacts + run: | + unzip ./reposense-deployment.zip + + - name: Deploy GitHub pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./reposense-report + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + commit_message: Rebuild pages at