[feat] CI/CD development. #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: Export and Deploy to Github Pages Repo | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm install | |
- name: Build Next.js project | |
run: npm run build | |
- name: Configure Git | |
run: | | |
git config --global user.name "yasgo" | |
git config --global user.email "[email protected]" | |
- name: Push to githubvisitorstats.github.io repo | |
run: | | |
cd out | |
git init | |
git branch -m main | |
git remote add origin https://github.com/githubvisitorstats/githubvisitorstats.github.io.git | |
git add . | |
git commit -m "Auto-export from githubvisitorstats-fe" | |
git push -f https://githubvisitorstats:${{ secrets.DESTINATION_REPO_PAT }}@github.com/githubvisitorstats/githubvisitorstats.github.io.git main |