Merge pull request #11 from Garados007/test-ci #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mabron Publish | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install deps | |
run: sudo apt-get install -y wget rsync ssh | |
# - name: create output | |
# run: mkdir -p publish | |
- name: build site | |
run: chmod +x build.sh && ./build.sh | |
- name: 'Build Zola' | |
uses: shalzz/zola-deploy-action@master | |
env: | |
BUILD_DIR: . | |
BUILD_FLAGS: --output-dir publish --base-url https://mabron.de/ | |
BUILD_ONLY: true | |
# - name: run worker script | |
# run: | | |
# wget https://mabron.de/updater/upload.hash.sh -O upload.sh | |
# chmod +x upload.sh | |
# cd publish | |
# ../upload.sh -u "https://mabron.de/updater/" -d "www.mabron.de" -p "" \ | |
# -t ${{ secrets.MABRON_UPDATE_TOKEN }} | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
name: id_rsa | |
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} # use ssh-keyscan to update these | |
config: ${{ secrets.SSH_CONFIG }} | |
if_key_exists: fail | |
- name: Fix publish permissions | |
run: | | |
sudo chown "$(id -u):$(id -g)" -R publish | |
- name: Load current filters | |
run: | | |
cd publish | |
rsync -rvzm --filter="+ */" --filter="+ .filter" --filter="- *" host:~/webroot/www/ . | |
- name: "Rsync: Upload changes" | |
run: | | |
cd publish | |
rsync -avz --delete --filter="- .filter" --filter=". .filter" . host:~/webroot/www/ |