Build and Deploy #315
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 | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'latest' | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Commit and push changes to repository | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'Automated build/product feed update' | |
- name: Get domain | |
id: get-domain | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'src/customizations/siteproperties.json' | |
prop_path: 'url' | |
- name: Add CNAME to dist | |
run: | | |
if [[ "${{ steps.get-domain.outputs.prop }}" != *.github.io ]]; then | |
echo ${{ steps.get-domain.outputs.prop }} > ./dist/CNAME | |
fi | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: gh-pages |