ari-express/.forgejo/workflows/deploy.yaml
Ari 73315e96e8
Some checks failed
Deploy to Web Server / deploy (push) Failing after 26s
Add the actual build step smh
2025-05-11 02:42:56 -04:00

38 lines
1.2 KiB
YAML

name: Deploy to Web Server
on:
push:
branches:
- main # Matches all branches
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- 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 /var/www/${{ github.ref_name }}"
- name: Install Deno
uses: https://github.com/denoland/setup-deno@v2
- name: build site
run: |
deno task build
- name: create folder if not exists
run: |
ssh -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} "mkdir -p /home/common/www/ariexpress/${{ github.ref_name }}"
- name: Deploy via SCP
run: |
scp -i ~/.ssh/id_ed25519 -rv ./_site/* ${{ vars.SERVER_USER }}@\[${{ vars.SERVER_HOST }}\]:/home/common/www/ariexpress/${{ github.ref_name }}