Skip to content

Commit

Permalink
add: created new files for GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
VaibhavSharmaAtAgoda committed Jun 29, 2024
1 parent 7c12c4f commit 8f8cfad
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/node.js.dev.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Build site
name: Build dev site and deploy

on:
pull_request:
branches: [ master ]
push:
branches: [ develop ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
environment: github-pages

strategy:
matrix:
Expand All @@ -22,3 +23,15 @@ jobs:
cache: 'npm'
- name: Installing dependencies
run: npm install
- 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
38 changes: 38 additions & 0 deletions .github/workflows/node.js.release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build release site and deploy

on:
push:
branches: [ master ]

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: Replacing the website's value for release
run: sed -i 's/dev-simple.ghostvaibhav.com/ghostvaibhav.com/g' package.json
- name: Installing dependencies
run: npm install
- 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
7 changes: 2 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Build site and deploy
name: Push to prod

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
environment: github-pages

Expand All @@ -26,7 +23,7 @@ jobs:
run: npm install
- name: Setting up Git
run: |
git remote set-url origin https://GhostVaibhav:${{ secrets.PASS }}@github.com/GhostVaibhav/Simple.git
git remote set-url origin https://GhostVaibhav:${{ secrets.PASS }}@github.com/GhostVaibhav/prod-Simple.git
git config --global user.email "[email protected]"
git config --global user.name "Vaibhav Sharma"
- name: Writing to environment variable
Expand Down

0 comments on commit 8f8cfad

Please sign in to comment.