update-deps (#5)
Rollup up action and dependency changes. Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
51
.gitea/workflows/deploy.yml
Normal file
51
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Build and Deploy Blog
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
if: github.event_name == 'pull_request' && github.event.action != 'closed'
|
||||
runs-on: debian-trixie
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Astro site
|
||||
run: npm run build
|
||||
|
||||
deploy:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: debian-trixie
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Astro site
|
||||
run: npm run build
|
||||
|
||||
- name: Setup SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.NANODE_SSH_KEY }}" > ~/.ssh/deploy_key
|
||||
chmod 600 ~/.ssh/deploy_key
|
||||
ssh-keyscan -H ${{ secrets.NANODE_HOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy to Nanode
|
||||
run: |
|
||||
rsync -avz --delete \
|
||||
-e "ssh -i ~/.ssh/deploy_key" \
|
||||
dist/ ${{ secrets.NANODE_USER }}@${{ secrets.NANODE_HOST }}:/var/www/smrising.com/
|
||||
Reference in New Issue
Block a user