dotfiles/.woodpecker/build.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

when:
- event: [pull_request, tag]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
variables:
- &rust_image 'git.nikos.gg/prymn/images/rust:1794cee2'
- &elixir_image 'git.nikos.gg/prymn/images/elixir:1794cee2'
- &cache_settings
endpoint: https://75178f9eca227dea51b3db4db2c15a5a.r2.cloudflarestorage.com
bucket: prymn-cache
region: auto
access-key:
from_secret: R2_CACHE_ACCESS_KEY
secret-key:
from_secret: R2_CACHE_SECRET_KEY
steps:
restore-elixir-cache:
image: meltwater/drone-cache
pull: true
settings:
<<: *cache_settings
cache_key: '{{ .Commit.Branch }}-{{ checksum "app/mix.lock" }}'
restore: true
mount:
- 'app/deps'
- 'app/_build/dev'
rust-build:
image: *rust_image
group: build
secrets: [ R2_CACHE_ACCESS_KEY, R2_CACHE_SECRET_KEY ]
commands:
- export AWS_ACCESS_KEY_ID="$${R2_CACHE_ACCESS_KEY}"
- export AWS_SECRET_ACCESS_KEY="$${R2_CACHE_SECRET_KEY}"
- cargo check
- ls $CARGO_HOME
when:
- path:
- "**/*.rs"
- "Cargo.*"
elixir-build:
image: *elixir_image
group: build
commands:
- cd app
- mix do deps.get, compile
when:
- path:
- "**/*.{ex,exs}"
- "mix.*"
rebuild-elixir-cache:
image: meltwater/drone-cache
pull: true
settings:
<<: *cache_settings
cache_key: '{{ .Commit.Branch }}-{{ checksum "app/mix.lock" }}'
rebuild: true
mount:
- 'app/deps'
- 'app/_build/dev'