chore: use Github actions for docs deployment

dependabot/npm_and_yarn/lodash-4.17.23
Boaz Poolman 2026-02-01 15:19:50 +01:00
parent a3f72e9ab9
commit 1c136240bc
1 changed files with 24 additions and 39 deletions

View File

@ -7,46 +7,31 @@ on:
jobs: jobs:
deploy: deploy:
name: Deploy
runs-on: ubuntu-latest
environment: environment:
name: docs.pluginpal.io name: github-pages
url: https://docs.pluginpal.io/config-sync url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
# 👇 Build steps
- name: Set up Docker - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: 16.x
cache: yarn
- name: Build a Docker image - name: Install dependencies
run: | run: cd docs && yarn install --frozen-lockfile --non-interactive
cd docs - name: Build
docker build \ run: cd docs && yarn build
-t docs-config-sync:latest . # 👆 Build steps
docker save -o ../docs-config-sync-latest.tar docs-config-sync:latest - name: Setup Pages
uses: actions/configure-pages@v3
- name: Transfer the Docker image to the Dokku server - name: Upload artifact
uses: appleboy/scp-action@v0.1.3 uses: actions/upload-pages-artifact@v2
with: with:
host: ${{ secrets.SSH_HOST }} # 👇 Specify build output path
username: ${{ secrets.SSH_CI_USERNAME }} path: docs/build
password: ${{ secrets.SSH_CI_PASSWORD }} - name: Deploy to GitHub Pages
source: docs-config-sync-latest.tar id: deployment
target: /var/lib/dokku/data/storage/docs/docker-images uses: actions/deploy-pages@v2
- 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