Skip to content

Trigger build.

Trigger build. #236

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build
permissions:
contents: write
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: 'Asia/Kolkata'
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Update Meta
run: |
DATE=$(date +'%B %d')
sed -i "s/{currentDate}/$DATE/g" src/pages/Meta.jsx
COMMIT_MSG=$(git log -1 --pretty=%B)
sed -i "s/{commitMessage}/$COMMIT_MSG/g" src/pages/Meta.jsx
- name: Install Dependencies
run: npm ci -f
- name: Build
run: npm run build --if-present
- name: Create 404 Page
run: cp dist/index.html dist/404.html
- name: Copy Resources
run: cp resources/* dist/ -r
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d dist -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}