diff --git a/.github/workflows/create_docker_image.yaml b/.github/workflows/create_docker_image.yaml new file mode 100644 index 0000000..690516b --- /dev/null +++ b/.github/workflows/create_docker_image.yaml @@ -0,0 +1,32 @@ +name: Create new docker image + +on: + release: + types: [published] + +jobs: + deploy: # https://docs.docker.com/ci-cd/github-actions/ + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + secrets: | + civicpy_version=${{ github.event.release.tag_name }} + push: true + tags: griffithlab/civicpy:${{ github.event.release.tag_name }},griffithlab/civicpy:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a0f83c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.7 + +RUN --mount=type=secret,id=civicpy_version \ + civicpy_version="$(cat /run/secrets/civicpy_version)" \ + && pip install civicpy==${civicpy_version} diff --git a/civicpy/__version__.py b/civicpy/__version__.py index 0172ae6..19dca0a 100644 --- a/civicpy/__version__.py +++ b/civicpy/__version__.py @@ -3,7 +3,7 @@ __url__ = 'http://civicpy.org' __major__ = '2' __minor__ = '0' -__patch__ = 'dev0' +__patch__ = '0' __meta_label__ = '' __short_version__ = "{}.{}".format(__major__, __minor__) __version__ = "{}.{}".format(__short_version__, __patch__)