This commit is contained in:
parent
e1814c38f6
commit
760d4c1a20
1 changed files with 39 additions and 0 deletions
39
.forgejo/workflows/deploy.yaml
Normal file
39
.forgejo/workflows/deploy.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Prepare and deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3
|
||||
|
||||
steps:
|
||||
- name: Checkout git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Prepare files
|
||||
run: |
|
||||
tar cvzf all-in-one.tar.gz .zshrc .p10k.zsh .local/
|
||||
|
||||
- name: Install Deployment Tools
|
||||
run: |
|
||||
if command -v apk >/dev/null; then
|
||||
apk add --no-cache rsync openssh-client
|
||||
else
|
||||
apt-get update && apt-get install -y rsync openssh-client
|
||||
fi
|
||||
|
||||
- name: Setup SSH
|
||||
uses: https://github.com/webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
rsync -avz -e "ssh -p ${{ secrets.SERVER_PORT }} -o StrictHostKeyChecking=no" --delete \
|
||||
./all-in-one.tar.gz \
|
||||
${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:${{ secrets.DESTINATION }}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue