Skip to content

Write to env variable #103

Write to env variable

Write to env variable #103

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
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'
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Commit and push changes to repository
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Automated build/blog 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'
- run: echo "DOMAIN=${{ steps.get-domain.outputs.value }}" >> $GITHUB_ENV
- name: Debug DOMAIN
run: echo "Debug DOMAIN=${{ env.DOMAIN }}"
- name: Add CNAME to dist
run: |
if [[ "${{ env.DOMAIN }}" != *.github.io ]]; then
echo ${{ env.DOMAIN }} > ./dist/CNAME
fi
- name: Debug CNAME
run: cat ./dist/CNAME
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: gh-pages