blog/.woodpecker/deploy.yml
Bruno BELANYI 83c66e7d46
All checks were successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/manual/deploy Pipeline was successful
WIP: ci: fix 'TYPE' variable usage
I *think* this way should have worked, but it doesn't [1].

So let's use an actual variable instead of interpolation, which *should*
work.
2023-11-01 19:15:25 +01:00

66 lines
1.3 KiB
YAML

labels:
backend: local
matrix:
include:
- TYPE: dev
MAKE_TARGET: build-dev
SSH_TARGET: ssh_target_dev
- TYPE: prod
MAKE_TARGET: build-prod
SSH_TARGET: ssh_target
# Run the correct matrix build on the correct branch
when:
evaluate: |
(CI_COMMIT_BRANCH == CI_REPO_DEFAULT_BRANCH) == (TYPE == "prod")
pipeline:
- name: check
image: bash
commands:
- nix flake check
- name: build (${TYPE})
image: bash
commands:
# If dev, include drafts and future articles, change base URL
- nix develop -c make ${MAKE_TARGET}
- name: deploy (${TYPE})
image: bash
environment:
# Trailing slash to synchronize the folder's *content* to the target
- SYNC_SOURCE=public/
secrets:
- source: ssh_key
target: sync_key
- source: ssh_port
target: sync_port
- source: ${SSH_TARGET}
target: sync_target
- source: ssh_user
target: sync_username
- source: ssh_host
target: sync_host
commands:
- "nix run github:ambroisie/nix-config#drone-rsync"
- name: notify
image: bash
secrets:
- source: matrix_homeserver
target: address
- source: matrix_password
target: pass
- source: matrix_roomid
target: room
- source: matrix_username
target: user
commands:
- nix run github:ambroisie/matrix-notifier
when:
status:
- failure
- success