Skip to content

publish_latest_tag #2840

publish_latest_tag

publish_latest_tag #2840

Workflow file for this run

name: Publish
on:
push:
branches:
- main
pull_request_target:
branches:
- main
repository_dispatch:
types:
- publish_latest_tag
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
deployments: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
environment:
name: ${{ github.event_name == 'push' && 'Production' || 'Preview' }}
url: ${{ steps.pages.outputs.alias }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Build
run: |
python -m fetch_downloads
JEKYLL_ENV=production bundle exec jekyll build --strict_front_matter
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: pages
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: _site
branch: ${{ github.event_name == 'push' && github.ref_name || github.event_name == 'repository_dispatch' && 'main' || github.event_name == 'workflow_dispatch' && 'main' || format('pr/{0}', github.event.pull_request.number) }}