Repository navigation
Merge pull request #548 from GSTT-CSC/545-c5-fellow-publication-update #318
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: Build and Deploy Jekyll site | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| # Full history so the step below can read each file's last commit date. | |
| fetch-depth: 0 | |
| - name: Restore data file and page modification times from git | |
| # A fresh checkout stamps every file with the clone time. The | |
| # "Last updated" dates on /resources, /literature, /publications and | |
| # /media come from these mtimes (of their _data files), as does the | |
| # date on /apply and /international (of their .md files), so set them | |
| # back to the last commit that touched each file. | |
| run: | | |
| for file in $(git ls-files _data '*.md'); do | |
| commit_date=$(git log -1 --format=%cI -- "$file") | |
| [ -n "$commit_date" ] && touch -d "$commit_date" "$file" | |
| done | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: bundle install | |
| - name: Build site | |
| run: bundle exec jekyll build | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./_site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |