1
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2025-03-31 05:20:06 +02:00
checkout/Dist ; bionic
2023-03-22 07:13:32 -05:00

71 lines
1.1 KiB
Text

dist: bionic
notifications:
email: false
services:
- docker
language: rust
before_install:
- rustup component add rustfmt
- cargo fmt --all -- --check
install:
- curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
before_script: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
heroku container:login
heroku container:pull --app=rfcbot-rs web
fi
script: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then heroku container:push --app=rfcbot-rs web; fi
docker-compose up -d
docker-compose exec web cargo test --release --locked
after_failure:
docker-compose logs web
before_cache:
# don't cache the cargo registry
- rm -rf "$HOME/.cargo/registry"
cache:
directories:
- "$HOME/.cargo"
before_deploy: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
docker-compose exec -e DATABASE_URL=$(heroku config:get DATABASE_URL --app=rfcbot-rs) web \
diesel migration run
fi
deploy:
provider: script
script: if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then heroku container:release --app=rfcbot-rs web; fi