From f52e3d995a5123473dbf4494c24e5e3cba89594a Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Tue, 28 May 2024 17:56:43 -0500 Subject: [PATCH 1/2] configure previews with access tokens and checkout to fork --- .github/workflows/preview.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 23856348..cb73cebe 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -8,25 +8,37 @@ on: - synchronize - closed -permissions: - contents: write - pull-requests: write jobs: deploy-preview: + environment: github-pages runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - - uses: actions/checkout@v3 - - uses: rossjrw/pr-preview-action@v1 + - name: Checkout PR + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Deploy to GH-Pages + uses: rossjrw/pr-preview-action@v1 + id: preview_step if: contains(['opened', 'reopened', 'synchronize'], ${{ github.event.action }}) with: source-dir: . preview-branch: gh-pages umbrella-dir: pr-preview + deploy-repository: "key4hep/dmx" + token: ${{ secrets.PR_TOKEN }} action: auto - - uses: rossjrw/pr-preview-action@v1 + + - name: Remove preview + uses: rossjrw/pr-preview-action@v1 if: github.event.action == 'closed' && !github.event.pull_request.merged with: source-dir: . preview-branch: gh-pages umbrella-dir: pr-preview + deploy-repository: "key4hep/dmx" + token: ${{ secrets.PR_TOKEN }} action: remove From 1f6ef69bf4afef44339521e3302e0aaa7855c2b6 Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Wed, 29 May 2024 14:51:07 -0500 Subject: [PATCH 2/2] small change to test previews workflows --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5a37f9ec..78348c21 100644 --- a/index.html +++ b/index.html @@ -16,9 +16,9 @@