Build and deploy #536
This file contains 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 | |
on: | |
push: | |
branches: | |
- main | |
# Regenerate the website every day: this will update the resume that is hosted | |
# and generated in a different repository. | |
schedule: | |
- cron: "0 0 * * *" | |
# Allows to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build & deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v3 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "latest" | |
- name: Download the resume | |
run: | | |
curl -s "https://api.github.com/repos/kirillbobyrev/resume/releases/latest" \ | |
| grep "Kirill-Bobyrev-Resume.pdf" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ | |
| tail -n 1 \ | |
| wget -i - | |
mv Kirill-Bobyrev-Resume.pdf static/resume.pdf | |
- name: Build website | |
run: hugo --gc --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |