2024-09-12 17:19:29 +00:00
|
|
|
---
|
|
|
|
name: Build and Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
2024-09-12 17:22:04 +00:00
|
|
|
build_and_deploy:
|
2024-09-12 17:19:29 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: cachix/install-nix-action@v26
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2024-09-12 21:22:49 +00:00
|
|
|
run: ./run ci:install
|
2024-09-12 17:19:29 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
2024-09-12 21:22:49 +00:00
|
|
|
run: ./run ci:test
|
2024-09-12 17:19:29 +00:00
|
|
|
|
|
|
|
- name: Generate the website
|
|
|
|
run: |
|
2024-09-12 21:22:49 +00:00
|
|
|
./run ci:build
|
2024-09-12 17:19:29 +00:00
|
|
|
tree output_prod
|
2024-09-12 17:31:34 +00:00
|
|
|
|
|
|
|
- name: Install the deploy key and known hosts
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
|
|
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/deploy && chmod 600 ~/.ssh/deploy
|
|
|
|
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts
|
|
|
|
|
|
|
|
- name: Deploy the website
|
|
|
|
run: ssh -i ~/.ssh/deploy oliverdavies-uk@ssh.oliverdavies.uk
|