Redeploy #212
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: Freeze the site | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
repository_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Poetry cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry | |
key: poetry-cache-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }} | |
- name: Pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: pip-cache-${{ runner.os }}-${{ hashFiles('.github/workflows/*.yml') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install poetry | |
poetry install | |
- name: Freeze the site | |
run: | | |
export NAUCSE_MAIN_REPO_URL=https://github.com/$GITHUB_REPOSITORY | |
export NAUCSE_MAIN_REPO_BRANCH=$GITHUB_REF_NAME | |
poetry run python -m naucse freeze --verbose | |
- if: ${{ github.ref == 'refs/heads/master' }} | |
name: Publish the site | |
run: | | |
poetry run python -m naucse deploy --push --no-freeze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: ghp_import | |
GIT_COMMITTER_NAME: ghp_import | |
EMAIL: none@invalid |