2020-02-07 00:37:16 +01:00
|
|
|
name: Build and Deploy c3woc website
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
# Environment variables available to all jobs and steps in this workflow
|
|
|
|
env:
|
2020-02-07 01:00:30 +01:00
|
|
|
LEKTOR_DEPLOY_KEY: ${{ secrets.LEKTOR_DEPLOY_KEY }}
|
2020-02-07 00:37:16 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [3.8]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
- name: Cache lfs data
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2020-02-07 01:00:30 +01:00
|
|
|
path: .git
|
|
|
|
key: .git/lfs
|
|
|
|
- name: install git-lfs && lektor
|
2020-02-07 00:37:16 +01:00
|
|
|
run: |
|
|
|
|
sudo apt-get install git-lfs
|
2020-02-07 01:00:30 +01:00
|
|
|
pip install lektor
|
|
|
|
- name: Cache lektor .cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/lektor
|
|
|
|
key: lektorcache
|
2020-02-07 00:37:16 +01:00
|
|
|
- name: pull lfs data
|
|
|
|
run: git lfs pull
|
|
|
|
- name: build with lektor
|
|
|
|
run: |
|
2020-02-07 01:00:30 +01:00
|
|
|
lektor build -f scss
|
2020-02-07 00:37:16 +01:00
|
|
|
- name: deploy new site
|
|
|
|
run: |
|
|
|
|
echo 'c3woc.de ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBC5NslYj+wtriBuKIxJfDRm9E2hnlstWR8durQ6pKvVvP7wjcoXIyAxe41GvJ9SoEhSjF7oVlzlw+zAkzl5WOZ4=' | sudo tee /etc/ssh/ssh_known_hosts
|
|
|
|
lektor deploy --key $LEKTOR_DEPLOY_KEY c3woc
|