Refactor deployment workflow to streamline SSH key handling and improve readability
Some checks failed
/ print-content (push) Has been cancelled

This commit is contained in:
암냥 2026-05-31 14:04:42 +09:00
commit 7783457ec1
No known key found for this signature in database

View file

@ -7,18 +7,36 @@ jobs:
run: uname -a run: uname -a
- name: checkout code - name: checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build - name: ssh-add
run: | run: |
source /etc/bashrc source /etc/bashrc
nix shell nixpkgs#bun nixpkgs#rsync nix shell nixpkgs#openssh
bun i
bun run build
echo "${{ secrets.SSH_KEY }}" > ssh_key echo "${{ secrets.SSH_KEY }}" > ssh_key
chmod 600 ssh_key chmod 600 ssh_key
eval "$(ssh-agent -s)" eval "$(ssh-agent -s)"
ssh-add ssh_key ssh-add ssh_key
rsync -avz --delete dist/* imnyang@10.11.8.101:/var/static/imnya.ng/. - name: Build
run: |
source /etc/bashrc
nix shell nixpkgs#bun
bun i
bun run build
- name: Deploy
run: |
source /etc/bashrc
nix shell nixpkgs#rsync nixpkgs#openssh
rsync -avz --delete -e "ssh -o StrictHostKeyChecking=no" dist/* imnyang@10.11.8.101:/var/static/imnya.ng/.
- name: Cleanup
run: |
source /etc/bashrc
nix shell nixpkgs#openssh
ssh-add -D ssh_key
rm ssh_key