mat.services/.drone.yml

48 lines
1.0 KiB
YAML
Raw Normal View History

2022-10-19 23:12:52 +00:00
kind: pipeline
type: docker
name: default
2022-10-20 01:03:02 +00:00
environment:
NIX: nix --extra-experimental-features 'nix-command flakes ca-derivations'
CACHE_NAME: mat
2022-10-19 23:12:52 +00:00
steps:
2022-10-20 01:03:02 +00:00
- name: set up cachix
image: nixos/nix
2022-10-20 01:04:10 +00:00
environment:
CACHIX_AUTH_TOKEN:
from_secret: cachix_auth_token
2022-10-20 01:03:02 +00:00
commands:
- $NIX profile install nixpkgs#cachix
- cachix use $CACHE_NAME
2022-10-19 23:12:52 +00:00
- name: nix build
image: nixos/nix
volumes:
2022-10-19 23:53:28 +00:00
- name: site
2022-10-19 23:57:49 +00:00
path: /site
2022-10-19 23:12:52 +00:00
commands:
2022-10-19 23:18:08 +00:00
- >
2022-10-20 01:03:02 +00:00
$NIX flake archive --json \
| jq -r '.path,(.inputs|to_entries[].value.path)' \
| cachix push $CACHE_NAME
- >
$NIX build \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push $CACHE_NAME
- cp -r result/* /site/
2022-10-19 23:12:52 +00:00
- name: netlify deploy
2022-10-19 23:46:08 +00:00
image: lucap/drone-netlify
2022-10-19 23:12:52 +00:00
volumes:
2022-10-19 23:53:28 +00:00
- name: site
2022-10-19 23:57:49 +00:00
path: /site
2022-10-19 23:12:52 +00:00
settings:
token:
from_secret: netlify_token
site_id:
from_secret: netlify_site_id
2022-10-19 23:57:49 +00:00
path: /site
volumes:
- name: site
temp: {}