Files
alkalist/.github/workflows/deploy.yml
T
rmcampos 7f2a4d72e2
Build Deploy to Pages / build (push) Successful in 5m42s
feat: fix deploy file and add more info
2026-06-17 18:13:51 -03:00

59 lines
1.5 KiB
YAML

name: Build Deploy to Pages
on:
workflow_dispatch:
push:
branches: [main]
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: true
env:
APP_FOLDER: "alkalist"
jobs:
build:
runs-on: easynode-debian
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm ci
- name: Build and export static site
run: npm run build
- name: Install rsync + ssh client
run: apt-get update -qq && apt-get install -y -qq rsync openssh-client
- name: Configure SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H "${{ secrets.DEPLOY_HOST }}" >> ~/.ssh/known_hosts
- name: Ensure destination folder exists
run: |
ssh -i ~/.ssh/deploy_key deploy@${{ secrets.DEPLOY_HOST }} \
"mkdir -p /srv/sites/${{ env.APP_FOLDER }} && chmod 755 /srv/sites/${{ env.APP_FOLDER }}"
- name: Upload site
run: |
rsync -avz --delete \
-e "ssh -i ~/.ssh/deploy_key" \
./out/ deploy@${{ secrets.DEPLOY_HOST }}:/srv/sites/${{ env.APP_FOLDER }}/