Refactor deployment workflow to streamline SSH key handling and improve readability
Some checks failed
/ print-content (push) Has been cancelled
Some checks failed
/ print-content (push) Has been cancelled
This commit is contained in:
parent
58ce75b38a
commit
7783457ec1
1 changed files with 24 additions and 6 deletions
|
|
@ -7,18 +7,36 @@ jobs:
|
|||
run: uname -a
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Build
|
||||
- name: ssh-add
|
||||
run: |
|
||||
source /etc/bashrc
|
||||
|
||||
nix shell nixpkgs#bun nixpkgs#rsync
|
||||
|
||||
bun i
|
||||
bun run build
|
||||
|
||||
nix shell nixpkgs#openssh
|
||||
echo "${{ secrets.SSH_KEY }}" > ssh_key
|
||||
chmod 600 ssh_key
|
||||
eval "$(ssh-agent -s)"
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue