This commit is contained in:
parent
c862db8191
commit
e6cf22111d
1 changed files with 33 additions and 0 deletions
33
.forgejo/workflows/deploy.yml
Normal file
33
.forgejo/workflows/deploy.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Remove non-production files
|
||||
run: |
|
||||
rm -rf *.md STATUS LICENSE .github .gitignore .forgejo
|
||||
- name: Deploy to Remote
|
||||
run: |
|
||||
if [ ! -d ~/.ssh ]; then
|
||||
mkdir -p ~/.ssh
|
||||
fi
|
||||
chmod 700 ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
dnf install -y rsync
|
||||
rsync -av --delete -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes -p ${{ secrets.SSH_PORT }}" . ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.WEB_ROOT }}/w3c-activitystreams-vocabulary
|
||||
- name: Clean up
|
||||
run: |
|
||||
rm -rf ~/.ssh
|
Loading…
Add table
Add a link
Reference in a new issue