Skip to content

Deploy to snapshots.slint.dev #8

Deploy to snapshots.slint.dev

Deploy to snapshots.slint.dev #8

name: Deploy to snapshots.slint.dev
on: workflow_dispatch
# push:
# paths: 'snapshots/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./snapshots
steps:
- name: Repository Checkout
uses: actions/checkout@v4
- name: npm install
run: |
npm install
- name: Clone website directory
run: |
git clone -b prod --single-branch https://user:${{ secrets.GITHUB_TOKEN }}@github.com/slint-ui/website.git --depth 1
- name: Generate docs.html and 404.html
run: |
mkdir -p website/output
cd website && go run generator/generator.go -skip-agreements
- name: Copy docs.html and 404.html
run: |
cp website/output/docs.html index.html
cp website/output/404.html 404.html
rm -rf website
- name: Install Netlify
run: |
npm install netlify-cli --save-dev
- name: Install Dependencies
run: |
npm ci
- name: Deploy to Netlify
id: netlify_deploy
run: |
netlify deploy \
--dir . \
--site ${{ secrets.NETLIFY_SNAPSHOTS_SITE_ID }} \
--auth ${{ secrets.NETLIFY_API_TOKEN }} \
--prod