From f1ea317fb58a1a912edbd1767c7b421bc73092c0 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Tue, 19 Nov 2024 09:35:43 +0000 Subject: [PATCH 1/9] Add PR preview workflow using GitHub Actions --- .github/workflows/pr-preview.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pr-preview.yml diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 000000000..e1881b1dc --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,37 @@ +name: PR Preview Deployment + +on: + pull_request: + branches: + - main # Trigger on PRs targeting the main branch + +jobs: + deploy-preview: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + + - name: Install dependencies + run: | + gem install bundler + bundle install + + - name: Build site + run: bundle exec jekyll build --destination ./_site + + - name: Deploy PR Preview + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site + publish_branch: gh-pages + allow_empty_commit: true + cname: '' # Omit custom domain for PR previews From a58803a37ab84b2c3dcb12bc5ae5c80ace69fab9 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Thu, 21 Nov 2024 21:15:42 +0100 Subject: [PATCH 2/9] Update access token --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e1881b1dc..3b812c5be 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -30,7 +30,7 @@ jobs: - name: Deploy PR Preview uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT_TOKEN }} publish_dir: ./_site publish_branch: gh-pages allow_empty_commit: true From 1b3946629651e897fe90a8639a6a48b9b5fbe954 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Thu, 21 Nov 2024 21:19:02 +0100 Subject: [PATCH 3/9] Update .github/workflows/pr-preview.yml --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 3b812c5be..8ba2bed6a 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -30,7 +30,7 @@ jobs: - name: Deploy PR Preview uses: peaceiris/actions-gh-pages@v3 with: - token: ${{ secrets.PAT_TOKEN }} + github_token: ${{ secrets.PAT_TOKEN }} publish_dir: ./_site publish_branch: gh-pages allow_empty_commit: true From 634e1d6157af6acb83184071179067e681c86eb4 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Thu, 21 Nov 2024 21:41:33 +0100 Subject: [PATCH 4/9] Update pr-preview.yml --- .github/workflows/pr-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 8ba2bed6a..e0bfa768f 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -35,3 +35,5 @@ jobs: publish_branch: gh-pages allow_empty_commit: true cname: '' # Omit custom domain for PR previews + environment: github-pages + From fe83ede064be0e59d709f7a7ced195a9b8b6c5f0 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Thu, 21 Nov 2024 21:47:15 +0100 Subject: [PATCH 5/9] Update pr-preview.yml --- .github/workflows/pr-preview.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index e0bfa768f..73ac49ad0 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -30,10 +30,8 @@ jobs: - name: Deploy PR Preview uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.PAT_TOKEN }} + personal_token: ${{ secrets.PAT_TOKEN }} publish_dir: ./_site publish_branch: gh-pages allow_empty_commit: true - cname: '' # Omit custom domain for PR previews - environment: github-pages - + cname: '' # Omit custom domain for PR preview From 8c0567f56af939de633a7453c61ad720cce5850d Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Thu, 21 Nov 2024 21:51:02 +0100 Subject: [PATCH 6/9] Update .github/workflows/pr-preview.yml --- .github/workflows/pr-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 73ac49ad0..1db3067c3 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -30,7 +30,7 @@ jobs: - name: Deploy PR Preview uses: peaceiris/actions-gh-pages@v3 with: - personal_token: ${{ secrets.PAT_TOKEN }} + personal_token: ${{ env.PAT_TOKEN }} publish_dir: ./_site publish_branch: gh-pages allow_empty_commit: true From 07c89699099e2ba96d4218607276529df8be05f9 Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Mon, 25 Nov 2024 19:07:29 +0100 Subject: [PATCH 7/9] Update pr-preview.yml --- .github/workflows/pr-preview.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 1db3067c3..1dc5de97c 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -35,3 +35,9 @@ jobs: publish_branch: gh-pages allow_empty_commit: true cname: '' # Omit custom domain for PR preview + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GH_TOKEN }} + From 78c9ba2e3a459577342babc353d321ea21f2967f Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Mon, 25 Nov 2024 19:10:49 +0100 Subject: [PATCH 8/9] Update pr-preview.yml --- .github/workflows/pr-preview.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 1dc5de97c..f6b26ddc3 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -27,17 +27,13 @@ jobs: - name: Build site run: bundle exec jekyll build --destination ./_site - - name: Deploy PR Preview + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: - personal_token: ${{ env.PAT_TOKEN }} + github_token: ${{ secrets.GH_TOKEN }} publish_dir: ./_site publish_branch: gh-pages allow_empty_commit: true cname: '' # Omit custom domain for PR preview - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GH_TOKEN }} From b5befc809d4f3cb94673d45a64c8231747705dca Mon Sep 17 00:00:00 2001 From: Deborah Udoh Date: Mon, 25 Nov 2024 19:24:09 +0100 Subject: [PATCH 9/9] Update pr-preview.yml --- .github/workflows/pr-preview.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index f6b26ddc3..b9d4bc07e 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -28,12 +28,11 @@ jobs: run: bundle exec jekyll build --destination ./_site - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GH_TOKEN }} - publish_dir: ./_site + publish_dir: ./public publish_branch: gh-pages allow_empty_commit: true cname: '' # Omit custom domain for PR preview -