Skip to content

Merge pull request #263 from jeanbez/jeanbez-patch-1 #137

Merge pull request #263 from jeanbez/jeanbez-patch-1

Merge pull request #263 from jeanbez/jeanbez-patch-1 #137

Workflow file for this run

name: CD
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [
main
]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
database:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install mysqlclient
- name: Update database
run: |
cd sql && python execute.py
env:
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_USER: ${{ secrets.DATABASE_USER }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: cd ${{ secrets.PROJECT_PATH }} && git pull