chore: revert to existing docs deployment strategy
parent
a6f01078b0
commit
8c70ceb0f2
|
|
@ -7,34 +7,46 @@ on:
|
|||
|
||||
jobs:
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: docs.pluginpal.io
|
||||
url: https://docs.pluginpal.io/config-sync
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
# 👇 Build steps
|
||||
- name: Set up Node.js
|
||||
|
||||
- name: Set up Docker
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
cache: yarn
|
||||
- name: Install dependencies
|
||||
run: cd docs && yarn install --frozen-lockfile --non-interactive
|
||||
- name: Build
|
||||
run: cd docs && yarn build
|
||||
# 👆 Build steps
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
node-version: '14'
|
||||
|
||||
- name: Build a Docker image
|
||||
run: |
|
||||
cd docs
|
||||
docker build \
|
||||
-t docs-config-sync:latest .
|
||||
docker save -o ../docs-config-sync-latest.tar docs-config-sync:latest
|
||||
|
||||
- name: Transfer the Docker image to the Dokku server
|
||||
uses: appleboy/scp-action@v0.1.3
|
||||
with:
|
||||
# 👇 Specify build output path
|
||||
path: docs/build
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_CI_USERNAME }}
|
||||
password: ${{ secrets.SSH_CI_PASSWORD }}
|
||||
source: docs-config-sync-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-config-sync-latest.tar
|
||||
DOCS_CONFIG_SYNC_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" docs-config-sync:latest)
|
||||
sudo docker tag docs-config-sync:latest docs-config-sync:$DOCS_CONFIG_SYNC_LATEST_IMAGE
|
||||
dokku git:from-image docs-config-sync docs-config-sync:$DOCS_CONFIG_SYNC_LATEST_IMAGE
|
||||
sudo docker system prune --all --force
|
||||
|
|
|
|||
Loading…
Reference in New Issue