added auto deployment
Some checks are pending
Astro Deploy Pipeline / Build-and-Deploy (push) Waiting to run
Some checks are pending
Astro Deploy Pipeline / Build-and-Deploy (push) Waiting to run
This commit is contained in:
parent
715807df9f
commit
8a90e5a206
1 changed files with 46 additions and 0 deletions
46
.forgejo/workflows/astro-deploy.yaml
Normal file
46
.forgejo/workflows/astro-deploy.yaml
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
name: Astro Deploy Pipeline
|
||||||
|
run-name: Builds the Astro site and Deploys via SSH to the Server
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build-and-Deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
|
- name: Checkout LFS objects
|
||||||
|
run: git lfs checkout
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
|
- name: Setup Rsync
|
||||||
|
uses: GuillaumeFalourd/setup-rsync@v1.2
|
||||||
|
|
||||||
|
- name: Build site
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Install SSH Key
|
||||||
|
uses: shimataro/ssh-key-action@v2
|
||||||
|
with:
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
known_hosts: 'placeholder' # to make it work
|
||||||
|
|
||||||
|
- name: Adding Known Hosts
|
||||||
|
run: ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Deploy with rsync
|
||||||
|
run: rsync -avz --delete ./dist/ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_TARGET }}
|
Loading…
Reference in a new issue