mat.services/.drone.yml

45 lines
1008 B
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:
2022-10-20 01:19:52 +00:00
NIX: nix --extra-experimental-features nix-command --extra-experimental-features flakes
2022-10-20 01:03:02 +00:00
CACHE_NAME: mat
2022-10-19 23:12:52 +00:00
steps:
- 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-20 01:12:29 +00:00
environment:
CACHIX_AUTH_TOKEN:
from_secret: cachix_auth_token
2022-10-19 23:12:52 +00:00
commands:
2022-10-20 01:20:43 +00:00
- nix-env --install --attr nixpkgs.cachix nixpkgs.jq
2022-10-20 01:12:29 +00:00
- cachix use $CACHE_NAME
2022-10-19 23:18:08 +00:00
- >
2022-10-20 01:19:52 +00:00
$NIX flake archive --json
| jq -r '.path,(.inputs|to_entries[].value.path)'
2022-10-20 01:03:02 +00:00
| cachix push $CACHE_NAME
- >
2022-10-20 01:19:52 +00:00
$NIX build
| jq -r '.[].outputs | to_entries[].value'
2022-10-20 01:03:02 +00:00
| 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: {}