mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-08 06:59:57 +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
94
test/cue.mod/pkg/universe.dagger.io/examples/todoapp/netlify.cue
vendored
Executable file
94
test/cue.mod/pkg/universe.dagger.io/examples/todoapp/netlify.cue
vendored
Executable file
|
|
@ -0,0 +1,94 @@
|
|||
package netlify
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"universe.dagger.io/alpine"
|
||||
"universe.dagger.io/bash"
|
||||
"universe.dagger.io/docker"
|
||||
"universe.dagger.io/netlify"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
client: {
|
||||
filesystem: {
|
||||
".": read: {
|
||||
contents: dagger.#FS
|
||||
exclude: [
|
||||
"README.md",
|
||||
"build",
|
||||
"netlify.cue",
|
||||
"node_modules",
|
||||
]
|
||||
}
|
||||
build: write: contents: actions.build.contents.output
|
||||
}
|
||||
env: {
|
||||
APP_NAME: string
|
||||
NETLIFY_TEAM: string
|
||||
NETLIFY_TOKEN: dagger.#Secret
|
||||
}
|
||||
}
|
||||
actions: {
|
||||
deps: docker.#Build & {
|
||||
steps: [
|
||||
alpine.#Build & {
|
||||
packages: {
|
||||
bash: {}
|
||||
yarn: {}
|
||||
git: {}
|
||||
}
|
||||
},
|
||||
docker.#Copy & {
|
||||
contents: client.filesystem.".".read.contents
|
||||
dest: "/src"
|
||||
},
|
||||
// bash.#Run is a superset of docker.#Run
|
||||
// install yarn dependencies
|
||||
bash.#Run & {
|
||||
workdir: "/src"
|
||||
mounts: "/cache/yarn": dagger.#Mount & {
|
||||
dest: "/cache/yarn"
|
||||
type: "cache"
|
||||
contents: dagger.#CacheDir & {
|
||||
id: "todoapp-yarn-cache"
|
||||
}
|
||||
}
|
||||
script: contents: #"""
|
||||
yarn config set cache-folder /cache/yarn
|
||||
yarn install
|
||||
"""#
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
test: bash.#Run & {
|
||||
input: deps.output
|
||||
workdir: "/src"
|
||||
script: contents: #"""
|
||||
yarn run test
|
||||
"""#
|
||||
}
|
||||
|
||||
build: {
|
||||
run: bash.#Run & {
|
||||
input: test.output
|
||||
workdir: "/src"
|
||||
script: contents: #"""
|
||||
yarn run build
|
||||
"""#
|
||||
}
|
||||
|
||||
contents: dagger.#Subdir & {
|
||||
input: run.output.rootfs
|
||||
path: "/src/build"
|
||||
}
|
||||
}
|
||||
|
||||
deploy: netlify.#Deploy & {
|
||||
contents: build.contents.output
|
||||
site: client.env.APP_NAME
|
||||
token: client.env.NETLIFY_TOKEN
|
||||
team: client.env.NETLIFY_TEAM
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue