Skip to content

Commit 8c70ceb

Browse files
committed
chore: revert to existing docs deployment strategy
1 parent a6f0107 commit 8c70ceb

1 file changed

Lines changed: 37 additions & 25 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,46 @@ on:
77

88
jobs:
99
deploy:
10-
environment:
11-
name: github-pages
12-
url: ${{ steps.deployment.outputs.page_url }}
10+
name: Deploy
1311
runs-on: ubuntu-latest
14-
permissions:
15-
pages: write
16-
id-token: write
12+
environment:
13+
name: docs.pluginpal.io
14+
url: https://docs.pluginpal.io/config-sync
1715
steps:
18-
- name: Checkout
16+
- name: Checkout repository
1917
uses: actions/checkout@v4
20-
# 👇 Build steps
21-
- name: Set up Node.js
18+
19+
- name: Set up Docker
2220
uses: actions/setup-node@v4
2321
with:
24-
node-version: 20.x
25-
cache: yarn
26-
- name: Install dependencies
27-
run: cd docs && yarn install --frozen-lockfile --non-interactive
28-
- name: Build
29-
run: cd docs && yarn build
30-
# 👆 Build steps
31-
- name: Setup Pages
32-
uses: actions/configure-pages@v4
33-
- name: Upload artifact
34-
uses: actions/upload-pages-artifact@v4
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+
uses: appleboy/scp-action@v0.1.3
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+
uses: appleboy/ssh-action@v0.1.10
3542
with:
36-
# 👇 Specify build output path
37-
path: docs/build
38-
- name: Deploy to GitHub Pages
39-
id: deployment
40-
uses: actions/deploy-pages@v4
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

0 commit comments

Comments
 (0)