2023-11-25 11:31:04 +01:00
|
|
|
# .github/workflows/deploy_wordpress_test1.yml
|
|
|
|
|
|
|
|
name: Deploy to https://wordpress-test.event-federation.eu/
|
|
|
|
|
|
|
|
on:
|
2023-11-25 11:33:22 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-11-25 11:31:04 +01:00
|
|
|
|
2023-11-25 11:21:20 +01:00
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
2023-11-25 13:27:17 +01:00
|
|
|
if: secrets.SSH_PRIVATE_KEY != '' && secrets.SSH_HOST_KEY != ''
|
2023-11-25 11:21:20 +01:00
|
|
|
|
|
|
|
steps:
|
2023-11-25 12:39:42 +01:00
|
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
2023-11-25 12:40:41 +01:00
|
|
|
- run: mkdir ~/.ssh
|
2023-11-25 13:26:52 +01:00
|
|
|
- run: echo "${{ secrets.SSH_HOST_KEY }}" > ~/.ssh/known_hosts
|
|
|
|
- run: chmod 600 ~/.ssh/known_hosts
|
2023-11-25 12:41:11 +01:00
|
|
|
- run: apt update && apt install -y openssh-client rsync
|
2023-11-25 13:12:17 +01:00
|
|
|
- run: eval $(ssh-agent -s) && echo "${{ secrets.SSH_PRIVATE_KEY }}" | ssh-add -
|
2023-11-25 13:31:33 +01:00
|
|
|
- run: ls -l ~/.ssh
|
|
|
|
- run: rsync -avzr -e "ssh -i /path/to/your/private-key" --delete ${{ github.workspace }}/ hosting187597@hosting187597.a2f96.netcup.net:~/wordpress-test.event-federation.eu/wp-content/plugins/
|