Add package.json to releases and snapshots #2
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: Deploy to snapshots.slint.dev | |
on: | |
push: | |
paths: 'snapshots/**' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository Checkout | |
uses: actions/checkout@v4 | |
- name: npm install | |
run: | | |
cd snapshots && npm install | |
- name: Clone website directory | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
ssh-agent sh -c 'echo "${{ secrets.WEBSITE_READ_SSH_KEY }}" | ssh-add - && git clone [email protected]:slint-ui/website.git --depth 1' | |
- name: Copy index.html and 404.html | |
run: | | |
cp website/docs.html index.html | |
cp website/404.html 404.html | |
rm -rf website | |
- name: Install Netlify | |
run: | | |
npm install [email protected] -g | |
- name: Install Dependencies | |
run: | | |
npm ci | |
- name: Build project | |
run: | | |
npm run build | |
- name: Deploy to Netlify | |
id: netlify_deploy | |
run: | | |
netlify deploy \ | |
--dir . \ | |
--site ${{ secrets.NETLIFY_SNAPSHOTS_SITE_ID }} \ | |
--auth ${{ secrets.NETLIFY_API_TOKEN }} \ | |
--prod |