init: astro publish site with newsletter, search, and actions workflow
Some checks failed
deploy / build-and-deploy (push) Has been cancelled
Some checks failed
deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
48
.gitea/workflows/deploy.yml
Normal file
48
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
|
||||
- name: Install
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
SITE_URL: ${{ secrets.SITE_URL }}
|
||||
PUBLIC_NEWSLETTER_ACTION: ${{ secrets.PUBLIC_NEWSLETTER_ACTION }}
|
||||
PUBLIC_NEWSLETTER_EMAIL_FIELD: ${{ secrets.PUBLIC_NEWSLETTER_EMAIL_FIELD }}
|
||||
PUBLIC_NEWSLETTER_TITLE: ${{ secrets.PUBLIC_NEWSLETTER_TITLE }}
|
||||
PUBLIC_NEWSLETTER_DESCRIPTION: ${{ secrets.PUBLIC_NEWSLETTER_DESCRIPTION }}
|
||||
run: npm run build
|
||||
|
||||
- name: Start SSH agent
|
||||
if: ${{ secrets.DEPLOY_SSH_KEY != '' }}
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
|
||||
- name: Add known_hosts
|
||||
if: ${{ secrets.DEPLOY_SSH_KEY != '' }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
ssh-keyscan -p "${{ secrets.DEPLOY_SSH_PORT }}" -H "${{ secrets.DEPLOY_SSH_HOST }}" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy via rsync
|
||||
if: ${{ secrets.DEPLOY_SSH_KEY != '' }}
|
||||
run: |
|
||||
rsync -az --delete -e "ssh -p ${{ secrets.DEPLOY_SSH_PORT }}" dist/ "${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }}:${{ secrets.DEPLOY_PATH }}/"
|
||||
Reference in New Issue
Block a user