pds-dash/.forgejo/workflows/deploy.yaml
Astra 965753107e
Some checks failed
Deploy / Deploy (push) Failing after 33s
I am so lost
2025-04-20 21:14:27 +09:00

50 lines
No EOL
1.4 KiB
YAML

name: Deploy
on:
push:
branches:
- main
- astra/ci
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Setup Deno
uses: https://github.com/denoland/setup-deno@v2
- name: Install dependencies
run: deno install
- name: Build project
run: deno task build
- name: Setup SCP
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod -R go-rwx ~/.ssh
ssh-keyscan -H ${{ vars.SERVER_HOST }} >> ~/.ssh/known_hosts
echo "Deploying to ${{ vars.SERVER_HOST }} as ${{ vars.SERVER_USER }} to /home/common/www/${{ github.ref_name }}"
- name: Debug SSH Connection
run: ssh -v -o PasswordAuthentication=no -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} echo "SSH Connection Successful"
- name: create folder if not exists
run: |
ssh -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} "mkdir -p /var/www/pds/${{ github.ref_name }}"
- name: Deploy via SCP
run: |
scp -i ~/.ssh/id_ed25519 -rv ./dist/* ${{ vars.SERVER_USER }}@\[${{ vars.SERVER_HOST }}\]:/var/www/pds/${{ github.ref_name }}