Skip to content

Commit aafc3c7

Browse files
committed
[feat] CI/CD development.
1 parent 9cd5510 commit aafc3c7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Export and Deploy to Github Pages Repo
2+
3+
on:
4+
push:
5+
branches:
6+
- main # 'main' branch'a commit atıldığında workflow çalışacak
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@v3
15+
16+
- name: Install dependencies
17+
run: npm install
18+
19+
- name: Build Next.js project
20+
run: npm run build
21+
22+
- name: Export Next.js project to static files
23+
run: npm run export
24+
25+
- name: Push to githubvisitorstats.github.io repo
26+
run: |
27+
cd out
28+
git init
29+
git remote add origin https://github.com/githubvisitorstats/githubvisitorstats.github.io.git
30+
git add .
31+
git commit -m "Auto-export from githubvisitorstats-fe"
32+
git push -f https://githubvisitorstats:${{ secrets.DESTINATION_REPO_PAT }}@github.com/githubvisitorstats/githubvisitorstats.github.io.git main

0 commit comments

Comments
 (0)