From ea7d893f230e01751a0d121307cd7f2f1b5403c4 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 11 Nov 2023 16:02:29 +1100 Subject: [PATCH] compile and deploy site on push to main update to github action: - installs dependencies - processes translations - compiles site - THEN deploys code to server --- .github/workflows/deploy.yml | 57 +++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6e6f9213..d7254fcc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy +name: Compile and Deploy on: push: @@ -6,20 +6,49 @@ on: - main jobs: - build: + 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 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: - - uses: actions/checkout@v2 - - name: Deploy to server - id: deploy - uses: Pendect/action-rsyncer@v1.1.0 - env: - DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} - with: - flags: '-avzr --delete' - options: '' - ssh_options: '' - src: 'site/' - dest: 'mouse@docs.joinbookwyrm.com:/var/www/docs-bookwyrm/html' + + - name: Checkout code + - uses: actions/checkout@v2 + + - name: Deploy to server + id: deploy + uses: Pendect/action-rsyncer@v2.0.0 + env: + DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} + with: + flags: '-avzr --delete' + options: '' + ssh_options: '' + src: 'site/' + dest: 'mouse@docs.joinbookwyrm.com:/var/www/docs-bookwyrm/html'