Merge pull request #767 from rust-lang/meetings-notes #59
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: Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install Hugo | |
run: sudo apt install hugo | |
- name: Minify HTML | |
run: hugo --minify | |
- name: Deploy | |
run: | | |
deploy_dir=public | |
# Ensure GitHub doesn't mess around with the uploaded file. | |
# Without the file, for example, files with an underscore in the name won't be | |
# included in the pages. | |
touch "${deploy_dir}/.nojekyll" | |
# Push the website to GitHub pages | |
cd "${deploy_dir}" | |
rm -rf .git | |
git init | |
git config user.name "Deploy from CI" | |
git config user.email "" | |
git add . | |
git commit -m "Deploy ${GITHUB_SHA} to gh-pages" | |
git push -f "https://x-token:${github_token}@github.com/${GITHUB_REPOSITORY}" master:gh-pages | |
env: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |