Deploy to Production (on VPS) #863
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 to Production (on VPS) | |
on: | |
push: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# source: https://stackoverflow.com/a/65698892 | |
# triggers this deployment after scaper runs | |
# for now this might have superfluous runs because the | |
# scraper will run and not commit anything, but after #215 is solved | |
# then it should only run after castablasta pushes a new episode | |
workflow_run: | |
# putting the comment here to enable prod changes in the future to leverage the created containers | |
workflows: ["Scrape and commit"] #, "Building Prod Container"] | |
types: | |
- completed | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Build | |
- name: Pull latest changes on VPS | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
USERNAME: ${{ secrets.VPS_DEPLOY_USER }} | |
PORT: ${{ secrets.VPS_SSH_PORT }} | |
KEY: ${{ secrets.VPS_SSHKEY }} | |
script: cd ${{ secrets.VPS_PROJECT_PATH }} && git pull | |
- name: Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
USERNAME: ${{ secrets.VPS_DEPLOY_USER }} | |
PORT: ${{ secrets.VPS_SSH_PORT }} | |
KEY: ${{ secrets.VPS_SSHKEY }} | |
script: cd ${{ secrets.VPS_PROJECT_PATH }} && make deploy-prod |