test pipeline #15
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: generate page site | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
name: Publish to Cloudflare Pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: npm ci | |
- run: npm run docs:build | |
- name: Check if version has been updated | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
echo "$(git describe --tags --abbrev=0 2>/dev/null || echo '')" | |
echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV | |
- name: Build Release (tag, release) | |
id: create_tag | |
uses: jaywcjlove/create-tag-action@main | |
if: env.previous_tag | |
with: | |
release: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
if: steps.check.outputs.has_changed == 'true' | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: dockit-site | |
directory: dist | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
environment: production |