-
-
Notifications
You must be signed in to change notification settings - Fork 21
53 lines (47 loc) · 1.76 KB
/
deploy-docs.yml
File metadata and controls
53 lines (47 loc) · 1.76 KB
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
name: Deploy Docs
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: startsWith(github.event.release.name, 'docs@')
environment:
name: docs.pluginpal.io
url: https://docs.pluginpal.io/webtools
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build a Docker image
run: |
cd packages/docs
docker build \
-t docs-webtools:latest .
docker save -o ../../docs-webtools-latest.tar docs-webtools:latest
- name: Transfer the Docker image to the Dokku server
uses: appleboy/scp-action@v0.1.3
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_CI_USERNAME }}
password: ${{ secrets.SSH_CI_PASSWORD }}
source: docs-webtools-latest.tar
target: /var/lib/dokku/data/storage/docs/docker-images
- name: Deploy the Dokku app based on the Docker image
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_CI_USERNAME }}
password: ${{ secrets.SSH_CI_PASSWORD }}
script_stop: true
script: |
sudo docker load -i /var/lib/dokku/data/storage/docs/docker-images/docs-webtools-latest.tar
DOCS_WEBTOOLS_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" docs-webtools:latest)
sudo docker tag docs-webtools:latest docs-webtools:$DOCS_WEBTOOLS_LATEST_IMAGE
dokku git:from-image docs-webtools docs-webtools:$DOCS_WEBTOOLS_LATEST_IMAGE
sudo docker system prune --all --force