diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..77a0916 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,47 @@ +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}} + diff --git a/Dockerfile b/Dockerfile index 8304dd9..8cda206 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7 +FROM python:3.10 LABEL maintainer="dan.leehr@duke.edu" # cwltool requires nodejs