better handling of onlyTitleRequested condition #6
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: tf-deploy | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: garygrossgarten/github-action-ssh@915e492551885a89131e21d85f2e043c96abff80 | |
with: | |
command: >- | |
become wp-graphql bash -c ' | |
set -eo pipefail; | |
cd $HOME/wp-graphql; | |
echo "Pulling git repo ..."; | |
git checkout main; | |
git pull --ff-only; | |
if [[ "$(git diff --name-only HEAD HEAD@{1} | grep -c package.json)" -gt 0 ]]; then | |
echo "Running npm install ..."; | |
npm install; | |
fi; | |
rsync -avu --delete --exclude .git $HOME/wp-graphql/ $HOME/www/js; | |
npm restart; | |
' | |
host: login.toolforge.org | |
username: ${{ secrets.TOOLFORGE_USERNAME }} | |
privateKey: ${{ secrets.TOOLFORGE_PRIVATE_KEY }} |