iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
😽
Setting up automated deployment to WordPress on Xserver using GitHub Actions
- Register the Xserver private key in GitHub Secrets
Refer to the official documentation:
- Create
.github/actions/deploy.yml
name: deploy to xserver
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Gulp or other build tools if necessary
# - name: gulp build
# uses: actions/setup-node@v1
# - run: yarn install && yarn run build\
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: sv1111.xserver.jp
- name: rsync deploy
run: rsync -vrlp -e "ssh -p 10022 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ./dist/ username@sv1111.xserver.jp:/home/username/example.net/public_html/dist/
References
This article is a cross-post from my personal blog.
Discussion