Update astro monorepo (#281) #789
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: | |
workflow_dispatch: | |
discussion_comment: | |
types: [created, deleted] | |
jobs: | |
cloudflare-pages: | |
name: Cloudflare Pages | |
runs-on: ubuntu-24.04-arm | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load secrets from 1Password | |
id: op-credentials | |
uses: 1password/load-secrets-action@v2 | |
with: | |
export-env: false | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
GH_API: 'op://prod/github-pat-sebboio/credential' | |
CLOUDFLARE_API_TOKEN: 'op://prod/cloudflare-sebboio-api-token/credential' | |
CLOUDFLARE_ACCOUNT_ID: 'op://prod/cloudflare-sebboio-api-token/account_id' | |
CLOUDFLARE_PROJECT_NAME: 'op://prod/cloudflare-sebboio-api-token/project_name' | |
- name: Set commit in environment | |
run: echo "COMMIT_ID=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version-file: '.bun-version' | |
no-cache: true | |
- run: bun install --frozen-lockfile | |
- run: bun --bun run lint | |
- run: bun --bun run stylelint | |
- run: bun --bun run format:check | |
- run: bun --bun run build | |
env: | |
GITHUB_USER: ${{ github.repository_owner }} | |
GITHUB_REPO: ${{ github.event.repository.name }} | |
GH_API: ${{ steps.op-credentials.outputs.GH_API }} | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ steps.op-credentials.outputs.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ steps.op-credentials.outputs.CLOUDFLARE_ACCOUNT_ID }} | |
command: 'pages deploy dist --project-name=${{ steps.op-credentials.outputs.CLOUDFLARE_PROJECT_NAME }}' | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |