Update main.yaml #13
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: Build and deploy page | |
# yamllint disable rule:truthy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
id-token: write | |
pages: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Setup yarn | |
# yarn: latest / berry / stable | |
run: | | |
corepack enable | |
yarn set version stable | |
- name: Clone react project | |
run: git clone https://github.com/waldiez/react.git | |
- name: Install dependencies and build the site | |
run: | | |
cd react | |
yarn install | |
echo "BASE_URL=/" > .env | |
echo "VITE_VS_PATH=vs" >> .env | |
yarn build:site | |
mv out/static ../site | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site | |
- name: Deploy | |
id: deployment | |
uses: actions/deploy-pages@v4 |