Configure Renovate - autoclosed #178
Workflow file for this run
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: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- name: lint | |
run: npm run lint | |
- name: check build | |
run: | | |
set -e | |
cp .envTEMPLATE .env | |
npm run dev & | |
sleep 10 | |
curl localhost:3000 | (sleep 10 && curl localhost:3000) | |
kill %1 # stop npm run dev | |
npm run compile | |
- name: determine whether we should deploy | |
if: ${{ github.repository == 'water-fountains/datablue' && github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/develop') }} | |
run: echo "::set-output name=deployIt::yes" | |
id: deployCheck | |
- name: setup SSH | |
if: ${{ steps.deployCheck.outputs.deployIt == 'yes' }} | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH }} | |
SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "$SSH_PRIVATE_KEY" | |
- name: deploy | |
if: ${{ steps.deployCheck.outputs.deployIt == 'yes' }} | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
BRANCH=$(if [ "${{ github.ref }}" == "refs/heads/stable" ]; then echo "stable"; else echo "develop"; fi) | |
ssh deploy@water-fountains.org "cd \"/var/www/datablue_$BRANCH\" && | |
git checkout \"origin/$BRANCH\" -- server/common/build.info.ts && | |
git fetch origin \"$BRANCH\" && | |
git reset --hard \"origin/$BRANCH\" && | |
./deploy.sh \"$BRANCH\"" | |
- name: cleanup ssh | |
if: ${{ steps.deployCheck.outputs.deployIt == 'yes' }} | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
ssh-add -D | |
rm -Rf * |