mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-03 21:49:50 +11:00
update action to dagger 0.2
- Remove AGE key setup - Update README to use `dagger do` - Update tests to dagger 0.2 Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
64f8bd95de
commit
24d6bfd692
96 changed files with 15028 additions and 70 deletions
109
test/cue.mod/pkg/universe.dagger.io/netlify/netlify.cue
vendored
Executable file
109
test/cue.mod/pkg/universe.dagger.io/netlify/netlify.cue
vendored
Executable file
|
|
@ -0,0 +1,109 @@
|
|||
// Deploy to Netlify
|
||||
// https://netlify.com
|
||||
package netlify
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
|
||||
"universe.dagger.io/alpine"
|
||||
"universe.dagger.io/docker"
|
||||
"universe.dagger.io/bash"
|
||||
)
|
||||
|
||||
// Deploy a site to Netlify
|
||||
#Deploy: {
|
||||
// Contents of the site
|
||||
contents: dagger.#FS
|
||||
|
||||
// Name of the Netlify site
|
||||
// Example: "my-super-site"
|
||||
site: string
|
||||
|
||||
// Netlify API token
|
||||
token: dagger.#Secret
|
||||
|
||||
// Name of the Netlify team (optional)
|
||||
// Example: "acme-inc"
|
||||
// Default: use the Netlify account's default team
|
||||
team: string | *""
|
||||
|
||||
// Domain at which the site should be available (optional)
|
||||
// If not set, Netlify will allocate one under netlify.app.
|
||||
// Example: "www.mysupersite.tld"
|
||||
domain: string | *null
|
||||
|
||||
// Create the site if it doesn't exist
|
||||
create: *true | false
|
||||
|
||||
// Build a docker image to run the netlify client
|
||||
_build: docker.#Build & {
|
||||
steps: [
|
||||
alpine.#Build & {
|
||||
packages: {
|
||||
bash: {}
|
||||
curl: {}
|
||||
jq: {}
|
||||
yarn: {}
|
||||
}
|
||||
},
|
||||
// FIXME: make this an alpine custom package, that would be so cool.
|
||||
docker.#Run & {
|
||||
command: {
|
||||
name: "yarn"
|
||||
args: ["global", "add", "netlify-cli@8.6.21"]
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
// Run the netlify client in a container
|
||||
container: bash.#Run & {
|
||||
input: *_build.output | docker.#Image
|
||||
script: {
|
||||
_load: dagger.#Source & {
|
||||
path: "."
|
||||
include: ["*.sh"]
|
||||
}
|
||||
directory: _load.output
|
||||
filename: "deploy.sh"
|
||||
}
|
||||
|
||||
always: true
|
||||
env: {
|
||||
NETLIFY_SITE_NAME: site
|
||||
if (create) {
|
||||
NETLIFY_SITE_CREATE: "1"
|
||||
}
|
||||
if domain != null {
|
||||
NETLIFY_DOMAIN: domain
|
||||
}
|
||||
NETLIFY_ACCOUNT: team
|
||||
}
|
||||
workdir: "/src"
|
||||
mounts: {
|
||||
"Site contents": {
|
||||
dest: "/src"
|
||||
"contents": contents
|
||||
}
|
||||
"Netlify token": {
|
||||
dest: "/run/secrets/token"
|
||||
contents: token
|
||||
}
|
||||
}
|
||||
|
||||
export: files: {
|
||||
"/netlify/url": _
|
||||
"/netlify/deployUrl": _
|
||||
"/netlify/logsUrl": _
|
||||
}
|
||||
}
|
||||
|
||||
// URL of the deployed site
|
||||
url: container.export.files."/netlify/url"
|
||||
|
||||
// URL of the latest deployment
|
||||
deployUrl: container.export.files."/netlify/deployUrl"
|
||||
|
||||
// URL for logs of the latest deployment
|
||||
logsUrl: container.export.files."/netlify/logsUrl"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue