waseoke commited on
Commit
92582c6
·
verified ·
1 Parent(s): d1f11fc

Create .github/workflows/push-to-github.yml

Browse files
.github/workflows/push-to-github.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Push to GitHub
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # Hugging Face Spaces의 기본 브랜치를 설정하세요.
7
+
8
+ jobs:
9
+ sync:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout repository
13
+ uses: actions/checkout@v3
14
+
15
+ - name: Set up Git
16
+ run: |
17
+ git config --global user.name "QQWaseokE"
18
+ git config --global user.email "[email protected]"
19
+
20
+ - name: Extract Commit Message
21
+ id: get_commit_message
22
+ run: |
23
+ export COMMIT_MESSAGE=$(jq -r '.head_commit.message' $GITHUB_EVENT_PATH)
24
+ echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
25
+
26
+ - name: Check for changes
27
+ run: git status
28
+
29
+ - name: Commit and Push to GitHub
30
+ env:
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
+ run: |
33
+ git add .
34
+ if ! git diff --cached --quiet; then
35
+ git commit -m "${COMMIT_MESSAGE}"
36
+ git push "https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/SK-Rookies-Final3/AI-Custom.git" HEAD:RF-184-Two-Tower-Model
37
+ else
38
+ echo "No changes to commit"
39
+ fi