docs(readme): some final touches #6
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: Cloudflare Pages | |
on: | |
push: | |
branches: | |
#- main | |
- labs/mkdocs-material | |
env: | |
CF_ACCOUNT_ID: 33e6189a4a87f1923e71af8da171e2ed | |
PAGES_PROJECT_NAME: recaptime-dev | |
PYTHON_VERSION: 3.13 | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
name: Deploy on main branch | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python runtime | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Set the date environmental variable | |
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- name: Set up build cache | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
key: buildkit-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
buildkit- | |
- name: Install dependencies | |
run: | | |
sudo apt-get install pngquant | |
pip install --user pipenv | |
- name: Install Python dependencies | |
run: pipenv install | |
- name: Deploy documentation | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
PYTHONPATH: . | |
run: | | |
pipenv run build --clean | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_BOT_API_TOKEN }} | |
accountId: ${{ env.CF_ACCOUNT_ID }} | |
projectName: ${{ env.PAGES_PROJECT_NAME}} | |
directory: public | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |