libflint/.gitea/workflows/jobs.yaml

60 lines
1.4 KiB
YAML

---
name: Test and Deploy
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libbsd-dev build-essential
- name: Build and test
run: |
make tests
docs:
runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/master'
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install SSH client
run: |
sudo apt-get update
sudo apt-get install -y openssh-client
- name: Setup SSH
run: |
mkdir -p ~/.ssh
ssh-keyscan -H burkey.co >> ~/.ssh/known_hosts
echo "${{ secrets.BURKEY_CO_KEY}}" >> ~/.ssh/id_rsa
chmod -R 700 ~/.ssh
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
- name: Install mkdocs
run: |
pip install mkdocs
- name: Build documentation
run: |
mkdocs build
- name: Deploy documentation
run: |
ssh debian@burkey.co "rm -rf /var/www/docs/libflint"
ssh debian@burkey.co "mkdir -p /var/www/docs/libflint"
ssh debian@burkey.co "chmod 755 /var/www/docs/libflint"
scp -r ./site/* debian@burkey.co:/var/www/docs/libflint/