Add remote SSH command for triggering Astro build

This commit is contained in:
Max Schmidt 2023-05-13 17:33:41 +02:00
parent c7bf11a5ee
commit c966a4dba9

View File

@ -1,28 +1,23 @@
name: Deploy Astro site name: Trigger Astro build on server
on: on:
push: push:
branches: ["main"] branches:
workflow_dispatch: - main
env:
BUILD_PATH: "./astro"
jobs: jobs:
build: build:
name: Build name: Run remote SSH command
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3 - name: Execute remote SSH commands
uses: appleboy/ssh-action@master
with: with:
node-version: "16" host: ${{ secrets.REMOTE_HOST }}
- name: Install dependencies username: ${{ secrets.REMOTE_USER }}
run: yarn install key: ${{ secrets.REMOTE_SSH_KEY }}
working-directory: ${{ env.BUILD_PATH }} script: |
- name: Build with Astro mkdir hallo
run: |
yarn astro build
working-directory: ${{ env.BUILD_PATH }}