update layouts for likes and bookmarks #422
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
audit-build-test-deploy: | |
name: 🔧 Audit, build, test, deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛎️ Checkout repo | |
# https://github.com/marketplace/actions/checkout | |
uses: actions/checkout@v4 | |
- name: 🖥️ Setup Node.js | |
# https://github.com/marketplace/actions/setup-node-js-environment | |
uses: actions/setup-node@v4 | |
with: | |
# https://github.com/nodejs/Release/blob/main/CODENAMES.md | |
node-version: lts/Iron | |
- run: npm ci --include dev --include prod | |
- name: 🛡️ Audit security | |
continue-on-error: true | |
run: npm audit --audit-level=moderate | |
- name: 🔧 Build website | |
env: | |
CLOUDINARY: ${{ secrets.CLOUDINARY }} | |
DEBUG: Eleventy:ErrorHandler,eleventy-plugin-text-to-speech/*,-eleventy-plugin-text-to-speech/transforms | |
DOMAIN: ${{ secrets.DOMAIN }} | |
GCP_CREDENTIALS_JSON: ${{ secrets.GCP_CREDENTIALS_JSON }} | |
NODE_ENV: production | |
STRIPE_LIVE: ${{ secrets.STRIPE_LIVE }} | |
TELEGRAM: ${{ secrets.TELEGRAM }} | |
WEBMENTION_IO_TOKEN: ${{ secrets.WEBMENTION_IO_TOKEN }} | |
WEBPAGETEST: ${{ secrets.WEBPAGETEST }} | |
run: npm run build | |
- name: 🔍 Test website | |
env: | |
STRIPE_TEST: ${{ secrets.STRIPE_TEST }} | |
run: npm run test | |
- name: 🌐 Deploy to Cloudflare Pages with Wrangler | |
id: deploy | |
# https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
command: pages deploy _site --project-name=personal-website | |
- name: print wrangler command output | |
env: | |
CMD_OUTPUT: ${{ steps.deploy.outputs.command-output }} | |
run: echo $CMD_OUTPUT | |
- name: 💬 Send Wrangler command output to Telegram | |
uses: appleboy/[email protected] | |
with: | |
to: ${{ fromJSON(secrets.TELEGRAM).chat_id }} | |
token: ${{ fromJSON(secrets.TELEGRAM).token }} | |
format: html | |
disable_web_page_preview: false | |
message: ${{ steps.deploy.outputs.command-output }} |