minor contact fix #75
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: pelican build | |
on: push | |
# push: | |
# branches: | |
# - main | |
# pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Upgrade pip | |
run: | | |
# install pip=>20.1 to use "pip cache dir" | |
python3 -m pip install --upgrade pip | |
- name: Get pip cache dir | |
id: pip-cache | |
run: echo "::set-output name=dir::$(pip cache dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: python3 -m pip install -r ./requirements.txt | |
- name: install theme | |
run: git clone https://github.com/alexandrevicenzi/Flex | |
- name: grab the pelican plugins | |
run: | | |
git clone --depth 1 --filter=blob:none --no-checkout https://github.com/getpelican/pelican-plugins/ | |
cd pelican-plugins | |
git checkout main -- post_stats | |
git checkout main -- summary | |
- name: grab the pelican plugins from the new location | |
run: | | |
git clone https://github.com/pelican-plugins/image-process | |
mv image-process/pelican/plugins/image_process pelican-plugins/ | |
git clone https://github.com/pelican-plugins/neighbors | |
mv neighbors/pelican/plugins/neighbors pelican-plugins/ | |
git clone https://github.com/pelican-plugins/render-math | |
mv render-math/pelican/plugins/render_math pelican-plugins/ | |
- name: grab the latest published version in order to not erase rss feed | |
run: git clone --branch gh-pages https://github.com/maggick/maggick.github.io output | |
- name: build | |
run: pelican | |
- name: Deploy | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
cd output | |
remote_repo="https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git" | |
git remote add deploy "$remote_repo" | |
git config user.name maggick | |
git config user.email maggick@users.noreply.github.com | |
git add ./ | |
timestamp=$(date +%s%3N) | |
git commit -m "[CI] Automated deployment to GitHub Pages on $timestamp" | |
echo $remote_branch | |
git show-ref | |
git push deploy HEAD:gh-pages --force | |