Merge pull request #120 from hughrun/deploy #109
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: Compile and Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Dev Dependencies | |
run: | | |
sudo apt-get install gettext | |
- name: Install Python Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Process translations | |
run: | | |
./bw-dev messages:update | |
- name: Compile site | |
run: | | |
python generate.py | |
deploy: | |
needs: compile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Deploy to server | |
id: deploy | |
uses: Pendect/[email protected] | |
env: | |
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} | |
with: | |
flags: '-avzr --delete' | |
options: '' | |
ssh_options: '' | |
src: 'site/' | |
dest: '[email protected]:/var/www/docs-bookwyrm/html' |