Skip to content

add: added conditional for deploying another branch #26

add: added conditional for deploying another branch

add: added conditional for deploying another branch #26

Workflow file for this run

name: Build dev site and deploy
on:
push:
branches: [ develop, development ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: github-pages
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Installing dependencies
run: npm install
- name: (Optional) Change the subdomain
if: github.ref == 'refs/heads/development'
run: |
sed -i 's/dev-simple.ghostvaibhav.com/theme-change.ghostvaibhav.com/g' package.json
echo 'theme-change.ghostvaibhav.com' > ./build/CNAME
- name: Setting up Git
run: |
git remote set-url origin https://GhostVaibhav:${{ secrets.PASS }}@github.com/GhostVaibhav/Simple.git
git config --global user.email "[email protected]"
git config --global user.name "Vaibhav Sharma"
- name: Writing to environment variable
run: |
touch .env
echo 'REACT_APP_RECAPTCHA_KEY=${{ secrets.REACT_APP_RECAPTCHA_KEY }}' >> .env
npm install gh-pages --save-dev
- name: Building and deploying the site
run: npm run deploy