Develops impact page v2 #113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy PR previews | |
| concurrency: preview-${{ github.ref }} | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| deploy-preview: | |
| permissions: write-all | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV" | |
| - name: Set Repo Name # Set in case the custom domain is not configured and the repo name needs to be added to the baseurl | |
| run: | | |
| REPO_NAME="${GITHUB_REPOSITORY##*/}" | |
| echo "REPO_NAME=$REPO_NAME" >> "$GITHUB_ENV" | |
| - name: Setup Ruby | |
| # https://github.com/ruby/setup-ruby/releases/tag/v1.207.0 | |
| uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 | |
| with: | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| cache-version: 0 # Increment this number if you need to re-download cached gems | |
| - uses: actions/setup-node@v4 | |
| - name: Install Node Dependencies | |
| run: npm install | |
| - name: Install and Build | |
| if: github.event.action != 'closed' # Skip the build if the PR has been closed | |
| run: gulp build && bundle exec jekyll build --baseurl "/pr-preview/pr-${{ github.event.number }}" | |
| env: | |
| JEKYLL_ENV: preview | |
| - name: Deploy preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: ./_site/ |