-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (50 loc) · 1.63 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy Website
on:
push:
branches:
- master
jobs:
deploy-website:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
- name: Install Bundler
run: gem install bundler -v 2.1.4
- name: Install dependencies
run: bundle install
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install npm dependencies
run: npm install
- name: Build the site
run: npm run build
- name: Configure CNAME
run: echo "docs.tapsell.ir" > _site/CNAME
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "tapsellCI"
git config --global url.https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/.insteadOf https://github.com/
- name: Deploy to GitHub Pages
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
git clone https://github.com/tapsellorg/TapsellDocument.git
cd TapsellDocument
if [ `git branch --list gh-pages` ]; then
git checkout gh-pages
else
git checkout --orphan gh-pages
fi
rm -rf *
cp -r ../_site/* .
git add -A
git commit -m "update gh pages"
git push https://tapsellCI:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/tapsellorg/TapsellDocument.git gh-pages --force