Skip to content

Instantly share code, notes, and snippets.

View zuzuleinen's full-sized avatar

Andrei Boar zuzuleinen

View GitHub Profile
@zuzuleinen
zuzuleinen / deploy.yaml
Created August 3, 2022 10:11
Deploy task
deploy:
cmd: netlify deploy --prod --dir=./build --site="$NETLIFY_SITE_ID" --auth="$NETLIFY_AUTH_TOKEN"
dependson:
- build
@zuzuleinen
zuzuleinen / deploy.cue
Last active August 3, 2022 10:10
Deploy action
// Deploy todoapp
deploy: netlify.#Deploy & {
contents: actions.build.output
site: string | *"dagger-todoapp"
}
@zuzuleinen
zuzuleinen / build.yaml
Last active August 5, 2022 10:34
build task for Dagger's Todo App
build:
input: |-
*
!build
!*.cue
!*.md
cmd: yarn run build
target: ./build
dependencies:
- yarn
@zuzuleinen
zuzuleinen / actions.cue
Last active August 3, 2022 10:06
source and build actions from Dagger's Todo App plan
source: core.#Source & {
path: "."
exclude: [
"node_modules",
"build",
"*.cue",
"*.md",
".git",
]
}
@zuzuleinen
zuzuleinen / bob.yaml
Last active August 5, 2022 10:35
Bobfile example for Dagger's Todo App
variables:
NETLIFY_SITE_ID: 11718535-163d-4092-90e3-2b05b23111af
build:
build:
input: |-
*
!*.cue
!*.md
cmd: yarn run build
target: ./build
@zuzuleinen
zuzuleinen / dagger.cue
Created August 3, 2022 09:59
Dagger plan for Todo App
package todoapp
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/netlify"
"universe.dagger.io/yarn"
)
dagger.#Plan & {
actions: {
// Load the todoapp source code
@zuzuleinen
zuzuleinen / check.yaml
Created July 20, 2022 07:34
Check build in bob
check:
rebuild: always
dependson:
- vet
- fmt
- testRace
@zuzuleinen
zuzuleinen / check.go
Created July 20, 2022 07:33
Hugo Check target in Mage
// Run tests and linters
func Check() {
if runtime.GOARCH == "amd64" && runtime.GOOS != "darwin" {
mg.Deps(Test386)
} else {
fmt.Printf("Skip Test386 on %s and/or %s\n", runtime.GOARCH, runtime.GOOS)
}
mg.Deps(Fmt, Vet)
// don't run two tests in parallel, they saturate the CPUs anyway, and running two
// causes memory issues in CI.
@zuzuleinen
zuzuleinen / isGoLatest.go
Created July 20, 2022 07:31
Fmt checking for latest Go
func Fmt() error {
if !isGoLatest() {
return nil
}
@zuzuleinen
zuzuleinen / test386.yaml
Created July 20, 2022 07:29
test386 build task
test386:
rebuild: always
cmd: export GOARCH=386 && go test ./... -timeout=1m && go env GOARCH