Remove guide from deployment #9
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 Pfaditechnik | |
on: | |
push: | |
branches: | |
- deploy | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: deploy | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Delete guide.md | |
run: rm guide.md | |
- name: Install dependencies | |
run: npm install | |
- name: Build the project | |
run: npm run docs:build | |
- name: Deploy via SSH | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
SSH_USERNAME: ${{ secrets.SSH_USERNAME }} | |
SSH_SERVER: ${{ vars.SSH_SERVER }} | |
DEPLOY_PATH: ${{ vars.DEPLOY_PATH }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan -H $SSH_SERVER >> ~/.ssh/known_hosts | |
cd .vitepress/dist | |
rsync -avz --delete . $SSH_USERNAME@$SSH_SERVER:$DEPLOY_PATH |