Use jsonnet config
continuous-integration/drone/push Build encountered an error Details

pull/1/head
mat ess 2022-10-20 18:40:22 -04:00
parent f8fed740c5
commit 0d0c260eae
2 changed files with 37 additions and 32 deletions

37
.drone.jsonnet Normal file
View File

@ -0,0 +1,37 @@
local Volume = { name: 'site', path: '/site' };
local NetlifyStep(env, prod) = {
name: 'netlify deploy ' + env,
image: 'internetmat/drone-netlify',
volumes: [Volume],
settings: {
token: { from_secret: 'netlify_token' },
site: { from_secret: 'netlify_site_id' },
path: '/site',
prod: prod,
},
};
{
kind: 'pipeline',
type: 'docker',
name: 'default',
environment: {
NIX: 'nix --extra-experimental-features nix-command --extra-experimental-features flakes',
},
volumes: [{ name: 'site', temp: {} }],
steps: [
{
name: 'nix build',
image: 'nixos/nix',
volumes: [Volume],
commands: [
'$NIX build',
'cp -r result/* /site/',
],
},
NetlifyStep('staging', false),
NetlifyStep('staging', true),
],
}

View File

@ -1,32 +0,0 @@
kind: pipeline
type: docker
name: default
environment:
NIX: nix --extra-experimental-features nix-command --extra-experimental-features flakes
steps:
- name: nix build
image: nixos/nix
volumes:
- name: site
path: /site
commands:
- $NIX build
- cp -r result/* /site/
- name: netlify deploy
image: lucap/drone-netlify
volumes:
- name: site
path: /site
settings:
token:
from_secret: netlify_token
site_id:
from_secret: netlify_site_id
path: /site
volumes:
- name: site
temp: {}