Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate Actions #532

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/build-deploy-cloudflare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Deploy (CloudFlare)

on:
push:
branches: ['main']
workflow_dispatch:
pull_request:

env:
GOOGLE_ANALYTICS_TRACKING_ID: ${{ secrets.GOOGLE_TAGMANAGER_ID_SCDF }}

permissions:
contents: read
pull-requests: write

jobs:
# build and deploy main/PR
build:
name: Build site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# agent may give node which doesn't work for us
- uses: actions/setup-node@v3
with:
node-version: 18.2.0

# do site build
- name: Yarn build
env:
NODE_OPTIONS: '--openssl-legacy-provider'
run: |
yarn install
yarn run fix
yarn build

# Publish on CloudFlare
- name: Publish to Cloudflare Pages
id: cloudflare-publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ secrets.CF_PROJECT_NAME }}
directory: public

# If PR, comment with the preview URL
- uses: mshick/add-pr-comment@v2
with:
message-id: cloudflare-deploy
message: |
🚀 Preview at ${{ steps.cloudflare-publish.outputs.url }}
# Chat Notification
# - name: Google Chat Notification
# uses: Co-qn/google-chat-notification@3691ccf4763537d6e544bc6cdcccc1965799d056
# with:
# name: Build (${{ matrix.runner }})
# url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
# status: ${{ job.status }}
# if: always()
Loading