Re-add a test workflow for pull requests
This commit is contained in:
parent
b9335578b8
commit
eeafffe3da
2 changed files with 27 additions and 0 deletions
38
.github/workflows/build_deploy.yaml
vendored
Normal file
38
.github/workflows/build_deploy.yaml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build_and_deploy:
|
||||
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
|
||||
run: ./run ci:install
|
||||
|
||||
- name: Run tests
|
||||
run: ./run ci:test
|
||||
|
||||
- name: Generate the website
|
||||
run: |
|
||||
./run ci:build
|
||||
tree output_prod
|
||||
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue