Skip to content

CI docker

CI docker #4

Workflow file for this run

name: build
on:
push:
branches:
- master
- issue-160
paths:
# Only rebuild website when apps have changed
- calrissian/**'
- .github/**
- Dockerfile
jobs:
version:
runs-on: ubuntu-latest
outputs:
app-version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v2
- run: echo "APP_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- run: echo app version is $APP_VERSION
- id: set-version
run: echo "::set-output name=version::$APP_VERSION"
container-build:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo version ${{needs.version.outputs.app-version}}
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: build & push image
run: |
IMAGE_ID=ghcr.io/Duke-GCB/calrissian/calrissian
docker build . --file Dockerfile --tag calrissian
docker tag calrissian $IMAGE_ID:${{needs.version.outputs.app-version}}
docker push $IMAGE_ID:${{needs.version.outputs.app-version}}