|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | deploy: |
10 | | - name: Deploy |
11 | | - runs-on: ubuntu-latest |
12 | 10 | environment: |
13 | | - name: docs.pluginpal.io |
14 | | - url: https://docs.pluginpal.io/config-sync |
| 11 | + name: github-pages |
| 12 | + url: ${{ steps.deployment.outputs.page_url }} |
| 13 | + runs-on: ubuntu-latest |
15 | 14 | steps: |
16 | | - - name: Checkout repository |
17 | | - uses: actions/checkout@v4 |
18 | | - |
19 | | - - name: Set up Docker |
20 | | - uses: actions/setup-node@v4 |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v3 |
| 17 | + # 👇 Build steps |
| 18 | + - name: Set up Node.js |
| 19 | + uses: actions/setup-node@v3 |
21 | 20 | with: |
22 | | - node-version: '14' |
23 | | - |
24 | | - - name: Build a Docker image |
25 | | - run: | |
26 | | - cd docs |
27 | | - docker build \ |
28 | | - -t docs-config-sync:latest . |
29 | | - docker save -o ../docs-config-sync-latest.tar docs-config-sync:latest |
30 | | -
|
31 | | - - name: Transfer the Docker image to the Dokku server |
32 | | - |
33 | | - with: |
34 | | - host: ${{ secrets.SSH_HOST }} |
35 | | - username: ${{ secrets.SSH_CI_USERNAME }} |
36 | | - password: ${{ secrets.SSH_CI_PASSWORD }} |
37 | | - source: docs-config-sync-latest.tar |
38 | | - target: /var/lib/dokku/data/storage/docs/docker-images |
39 | | - |
40 | | - - name: Deploy the Dokku app based on the Docker image |
41 | | - |
| 21 | + node-version: 16.x |
| 22 | + cache: yarn |
| 23 | + - name: Install dependencies |
| 24 | + run: cd docs && yarn install --frozen-lockfile --non-interactive |
| 25 | + - name: Build |
| 26 | + run: cd docs && yarn build |
| 27 | + # 👆 Build steps |
| 28 | + - name: Setup Pages |
| 29 | + uses: actions/configure-pages@v3 |
| 30 | + - name: Upload artifact |
| 31 | + uses: actions/upload-pages-artifact@v2 |
42 | 32 | with: |
43 | | - host: ${{ secrets.SSH_HOST }} |
44 | | - username: ${{ secrets.SSH_CI_USERNAME }} |
45 | | - password: ${{ secrets.SSH_CI_PASSWORD }} |
46 | | - script_stop: true |
47 | | - script: | |
48 | | - sudo docker load -i /var/lib/dokku/data/storage/docs/docker-images/docs-config-sync-latest.tar |
49 | | - DOCS_CONFIG_SYNC_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" docs-config-sync:latest) |
50 | | - sudo docker tag docs-config-sync:latest docs-config-sync:$DOCS_CONFIG_SYNC_LATEST_IMAGE |
51 | | - dokku git:from-image docs-config-sync docs-config-sync:$DOCS_CONFIG_SYNC_LATEST_IMAGE |
52 | | - sudo docker system prune --all --force |
| 33 | + # 👇 Specify build output path |
| 34 | + path: docs/build |
| 35 | + - name: Deploy to GitHub Pages |
| 36 | + id: deployment |
| 37 | + uses: actions/deploy-pages@v2 |
0 commit comments