Skip to content

18-19 update actions/checkout to @v4 and .htaccess deployment #8

18-19 update actions/checkout to @v4 and .htaccess deployment

18-19 update actions/checkout to @v4 and .htaccess deployment #8

Workflow file for this run

# See https://stackoverflow.com/questions/60710209/trigger-github-actions-only-when-pr-is-merged
name: Deploy
concurrency: production
on:
pull_request:
types: [closed]
workflow_dispatch:
env:
SSH_USER: planttracer
APP_HOST: planttracer.com
DEPLOY_DIR: planttracer.com/web-static
jobs:
if-merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Deploy to $APP_HOST $DEPLOY_DIR"
run: |
echo APP_HOST: $APP_HOST DEPLOY_DIR: $DEPLOY_DIR
eval $(ssh-agent)
base64 -d <<< "${{ secrets.PT_SSH_BASE64 }}" | ssh-add -
ssh-add -l
ssh -o StrictHostKeyChecking=no -o GlobalKnownHostsFile=etc/known_hosts $SSH_USER@$APP_HOST "python3 --version; hostname; pwd; cd $DEPLOY_DIR; ls -l"
ssh -o StrictHostKeyChecking=no -o GlobalKnownHostsFile=etc/known_hosts $SSH_USER@$APP_HOST "cd $DEPLOY_DIR; git checkout main && git pull --recurse-submodules"