dotfiles/.woodpecker/release-app.yml
2023-09-03 15:18:06 +03:00

35 lines
977 B
YAML

labels:
platform: linux/arm64
when:
- event: tag
branch: main
steps:
make-release:
image: docker.io/hexpm/elixir:1.15.5-erlang-26.0.2-debian-bookworm-20230612
environment:
- MIX_ENV=prod
commands:
- apt-get update -y && apt-get install -y build-essential
- cd app
- mix local.hex --force && mix local.rebar --force
- mix deps.get --only prod
- mix compile
- mix assets.deploy
- mix phx.gen.release
- mix release
deploy:
image: alpine:latest
environment:
- REMOTE_SERVER="prymnci@${APP_SERVER_ADDRESS}"
- DEPLOY_PATH="/srv/app"
commands:
- apk add --no-cache openssh-client rsync
- eval $(ssh-agent -s)
- echo "${DEPLOY_KEY}" | ssh-add -
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "${DEPLOY_KEY}" > ~/.ssh/known_hosts
- cd app && rsync -avz --delete _build/prod/rel/prymn/ "${REMOTE_SERVER}:${DEPLOY_PATH}"
secrets: [ DEPLOY_KEY ]