feat: load example #11
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 Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
TARGET_DIR: dist/signal-spreadsheet | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Set environment variable based on branch | |
run: | | |
if [[ $GITHUB_REF == refs/heads/main || $GITHUB_REF == refs/heads/master ]]; then | |
echo "Branch is main or master. Setting DRY_RUN_OPTION to empty." | |
echo "DRY_RUN_OPTION=" >> $GITHUB_ENV | |
else | |
echo "Branch is not main or master. Setting DRY_RUN_OPTION to '--dry-run'." | |
echo "DRY_RUN_OPTION=--dry-run" >> $GITHUB_ENV | |
fi | |
- name: Install | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Deploy Website (gh-pages branch) | |
env: | |
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} # A token must be created to be able to deploy on the gh-pages branch | |
run: | | |
echo "DRY_RUN_OPTION=$DRY_RUN_OPTION" | |
npx angular-cli-ghpages --no-silent --name="Michał Nieruchalski" [email protected] --branch=gh-pages --dir="${{env.TARGET_DIR}}" $DRY_RUN_OPTION --cname=spreadsheet.nieruchalski.dev |