Preparing for r151052 #215
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: Publish | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Jekyll build | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt-get install -y libxslt-dev lftp | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
- name: Generate Site | |
run: | | |
bundle exec jekyll build | |
bundle exec htmlproofer ./_site --enforce-https=false --disable-external=true | |
- name: Publish to OOCE Web Server | |
if: ${{github.event_name}} == "push" && ${{github.ref}} == "refs/heads/master" | |
env: | |
DEPLOY_KEY: ${{secrets.DEPLOY_SECRET}} | |
run: | | |
if [ -n "$DEPLOY_KEY" ]; then | |
echo "$DEPLOY_KEY" > site-deploy-key | |
chmod 600 site-deploy-key | |
lftp -e 'set sftp:connect-program "ssh -o StrictHostKeyChecking=no -l ${{secrets.DEPLOY_USER}} -a -x -i site-deploy-key"; mirror -R --verbose --use-pget-n=5 --parallel=5 _site site;exit' sftp://${{secrets.DEPLOY_HOST}}:${{secrets.DEPLOY_PORT}} || true | |
rm -f site-deploy-key | |
else | |
echo "Not deploying" | |
fi | |