-
Notifications
You must be signed in to change notification settings - Fork 1
26 lines (24 loc) · 1001 Bytes
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Docker image
on: [push, pull_request]
jobs:
docker-build:
name: Build & Test Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Create Docker tag
id: docker_image_tag
if: success()
run: echo ::set-output name=TAG::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
- name: Build :latest Docker image
if: success()
run: docker build -t ${{ steps.docker_image_tag.outputs.TAG }}:latest ./
- name: Start PostgreSQL
if: success()
run: docker run --env-file .env.local --name pgsql -d postgres
- name: Test database upgrade
if: success()
run: docker run --link pgsql --env-file .env.local ${{ steps.docker_image_tag.outputs.TAG }} alembic-3 upgrade head
- name: Test database downgrade
if: success()
run: docker run --link pgsql --env-file .env.local ${{ steps.docker_image_tag.outputs.TAG }} alembic-3 downgrade base