workflow: working out on deploy automation #3
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 and Deploy to cPanel | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.8.1 | |
- name: Install dependencies and build | |
run: | | |
cd client | |
npm install | |
npm run build | |
- name: Configure git | |
run: | | |
git config user.email "im.shubhamlal@gmail.com" | |
git config user.name "Shubham Lal" | |
- name: Commit and push | |
env: | |
GH_CPANEL: ${{ secrets.GH_CPANEL }} | |
run: | | |
git add . | |
git commit -m "Build for deployment" | |
git push https://${GH_CPANEL}@github.com/Shubham-Lal/GitHub-Clone.git HEAD:main |