Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LuckyArdhika/078159139d59fc65c18f00699d86ff2b to your computer and use it in GitHub Desktop.
Save LuckyArdhika/078159139d59fc65c18f00699d86ff2b to your computer and use it in GitHub Desktop.
name: Application Test and Release Workflow
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v1.0.0
- uses: actions/setup-elixir@v1.0.0
with:
otp-version: 22.x
elixir-version: 1.9.x
- run: mix deps.get
- run: mix test
release:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v1.0.0
- run: |+
cat >~/.netrc <<EOF
machine api.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
- run: heroku git:remote -a $(basename ${{ github.repository}} )
- run: git push heroku HEAD:refs/heads/master
- run: heroku run "POOL_SIZE=2 mix ecto.migrate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment