Skip to content

Commit 78ca5ca

Browse files
committed
Rewrite CI
1 parent 25ca255 commit 78ca5ca

1 file changed

Lines changed: 51 additions & 25 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,69 @@
1-
name: Deploy updated website
1+
name: CI
22

33
on:
4-
push
4+
push:
5+
branches: [ dev ]
56

67
jobs:
78
build:
89
runs-on: ubuntu-latest
910
steps:
10-
- name: Checkout gbdev/gbdev.github.io
11+
- name: Checkout virens
1112
uses: actions/checkout@v2
1213
with:
13-
repository: gbdev/gbdev.github.io
14-
path: folder/repo
15-
- name: Checkout gbdev/gbdev.github.io master
14+
path: gbdevio
15+
16+
- name: Install NodeJS
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '12.x'
20+
21+
- name: Install npm requirements
22+
run: npm install
23+
working-directory: gbdevio/
24+
25+
- name: Run Vue build
26+
run: npm run build
27+
working-directory: gbdevio/
28+
29+
- name: Store final build
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: Build output
33+
path: gbdevio/website/.vuepress/dist
34+
if-no-files-found: error
35+
36+
deploy:
37+
runs-on: ubuntu-latest
38+
needs: build
39+
steps:
40+
- name: Checkout virens/gh-pages
1641
uses: actions/checkout@v2
1742
with:
18-
repository: gbdev/gbdev.github.io
43+
path: gbdevio
1944
ref: master
20-
path: folder/build
2145

22-
- uses: actions/setup-node@v1
46+
- name: Delete all current files
47+
run: |
48+
rm -vrf gbdevio/*
49+
50+
- name: Unpack build
51+
uses: actions/download-artifact@v2
2352
with:
24-
node-version: '12'
53+
name: Build output
54+
path: gbdevio/
55+
56+
- name: Create CNAME file
57+
run: |
58+
echo "gbdev.io" > gbdevio/CNAME
2559
26-
- working-directory: folder/
60+
- name: Deploy to gbdev.io
61+
working-directory: gbdevio/
2762
run: |
28-
cd repo
29-
npm install
30-
npm run build
31-
mkdir dist
32-
cp website/.vuepress/dist/* dist/ -r
33-
cp CNAME dist/
34-
cd ..
35-
cp -a repo/dist/. build/
36-
cd build
37-
mkdir -m 700 ~/.ssh
38-
echo "${{ secrets.SSH_KEY_SECRET }}" > ~/.ssh/id_ed25519
39-
chmod 0600 ~/.ssh/id_ed25519
4063
git config --local user.name "GitHub Action"
4164
git config --global user.email "community@gbdev.io"
42-
git add .
43-
git commit -m "Update build" && git push || :
65+
git remote -v
66+
git branch -v
67+
git add -A
68+
git commit -am 'Update build'
69+
git push -v

0 commit comments

Comments
 (0)