Skip to content

fix(api): pytest in python-script-template (#372) #363

fix(api): pytest in python-script-template (#372)

fix(api): pytest in python-script-template (#372) #363

name: CI/CD Pipeline
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build Website
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: lts/*
- name: Run build
run: |
cd website
npm ci && npm run build
- name: Upload artifact
uses: actions/[email protected]
with:
name: mkeithx__build
path: website/build
- name: Upload pages artifact
if: github.event_name == 'push'
uses: actions/[email protected]
with:
path: website/build
deploy:
if: github.event_name == 'push'
name: Deploy to GitHub Pages
concurrency: build-deploy-pages
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download Build Artifact
uses: actions/[email protected]
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
publish:
if: ${{ github.event_name != 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main' }}
name: Deploy to Cloudflare
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
deployments: write
steps:
- name: Download WF Artifact
uses: actions/[email protected]
with:
name: mkeithx__build
path: website/build
- name: Deploy to Cloudflare
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: |
pages deploy website/build --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }}
# https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler