Merge pull request #53 from GhostVaibhav/hotfix-update-ci-pipeline #53
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 dev site and deploy | |
on: | |
push: | |
branches: [ develop ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: github-pages | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: develop | |
- 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: Writing to environment variable | |
run: | | |
touch .env | |
echo 'REACT_APP_RECAPTCHA_KEY=${{ secrets.REACT_APP_RECAPTCHA_KEY }}' >> .env | |
- name: Build the website | |
run: npm run build | |
- name: Creating the CNAME file | |
run: echo 'dev-simple.ghostvaibhav.com' > ./build/CNAME | |
- name: Pushes to another repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'build' | |
destination-github-username: 'GhostVaibhav' | |
destination-repository-name: 'dev-Simple' | |
user-email: [email protected] | |
target-branch: main |