-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.32 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Deploy to t-ibrahimm.github.io
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the t-website repository
- name: Checkout t-website repository
uses: actions/checkout@v2
# Step 2: Checkout the t-ibrahimm.github.io repository into the 'deploy' directory
- name: Checkout t-ibrahimm.github.io repository
uses: actions/checkout@v2
with:
repository: t-ibrahimm/t-ibrahimm.github.io
token: ${{ secrets.TARGET_REPO_TOKEN }}
path: deploy
# Step 3: Copy all files from t-website to the 'deploy' directory, excluding the 'deploy' directory itself
- name: Copy files
run: cp -r $(ls -A | grep -v deploy) deploy/
# Step 4: Configure Git user, commit, and push changes
- name: Commit and push changes
run: |
cd deploy
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff-index --quiet HEAD || git commit -m "Update from t-website"
git push origin master
# Step 5: Install dependencies and deploy
- name: Install dependencies and deploy
run: |
cd deploy
yarn install
yarn deploy