Update cli.md #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: | |
name: docs.pluginpal.io | |
url: https://docs.pluginpal.io | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Build a Docker image | |
run: | | |
docker build \ | |
-t pluginpal-docs:latest . | |
docker save -o pluginpal-docs-latest.tar pluginpal-docs:latest | |
- name: Transfer the Docker image to the Dokku server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_CI_USERNAME }} | |
password: ${{ secrets.SSH_CI_PASSWORD }} | |
source: pluginpal-docs-latest.tar | |
target: /var/lib/dokku/data/storage/docs/docker-images | |
- name: Deploy the Dokku app based on the Docker image | |
uses: appleboy/[email protected] | |
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/pluginpal-docs-latest.tar | |
DOCS_LATEST_IMAGE=$(sudo docker images --format "{{.ID}}" pluginpal-docs:latest) | |
sudo docker tag pluginpal-docs:latest pluginpal-docs:$DOCS_LATEST_IMAGE | |
dokku git:from-image docs pluginpal-docs:$DOCS_LATEST_IMAGE | |
sudo docker system prune --all --force |