Skip to content

Deploy to slintpad.com #5

Deploy to slintpad.com

Deploy to slintpad.com #5

name: Deploy to slintpad.com
on:
push:
paths: 'slintpad/**'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./slintpad
steps:
- name: Repository Checkout
uses: actions/checkout@v4
- name: npm install
run: |
npm install
- name: Generate a token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.READ_WRITE_APP_ID }}
private-key: ${{ secrets.READ_WRITE_PRIVATE_KEY }}
repositories: website
- name: Clone website directory
uses: actions/checkout@v4
with:
repository: slint-ui/website
ref: prod
path: slintpad/website
token: ${{ steps.app-token.outputs.token }}
- name: Generate 404.html
run: |
mkdir -p website/output
cd website && go run generator/generator.go -skip-agreements
- name: Copy 404.html
run: |
cp website/output/404.html 404.html
rm -rf website
- name: Set environment variables
run: |
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
- name: Publish to slintpad
run: |
npx wrangler@3 pages deploy . --project-name=slintpad --commit-dirty=true