|
1 | | -name: Deploy updated website |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push |
| 4 | + push: |
| 5 | + branches: [ dev ] |
5 | 6 |
|
6 | 7 | jobs: |
7 | 8 | build: |
8 | 9 | runs-on: ubuntu-latest |
9 | 10 | steps: |
10 | | - - name: Checkout gbdev/gbdev.github.io |
| 11 | + - name: Checkout virens |
11 | 12 | uses: actions/checkout@v2 |
12 | 13 | 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 |
16 | 41 | uses: actions/checkout@v2 |
17 | 42 | with: |
18 | | - repository: gbdev/gbdev.github.io |
| 43 | + path: gbdevio |
19 | 44 | ref: master |
20 | | - path: folder/build |
21 | 45 |
|
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 |
23 | 52 | 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 |
25 | 59 |
|
26 | | - - working-directory: folder/ |
| 60 | + - name: Deploy to gbdev.io |
| 61 | + working-directory: gbdevio/ |
27 | 62 | 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 |
40 | 63 | git config --local user.name "GitHub Action" |
41 | 64 | 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