Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and Deploy

on:
push:
branches:
- main
tags:
- '\d+.\d+.\d+'

permissions:
id-token: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build, Tag, and Push Docker Image
run: |
ci/docker-build-image -p

7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ See [Semantic Versioning](https://semver.org/) for help selecting the next versi
- If the jobs completed successfully, a new tag matching the "#.#.#" pattern should have been added to main.
You can check the [tags page](https://github.com/seqwell/longplexpy/tags)
- If the jobs completed successfully, there should also be a new release on the [releases page](https://github.com/seqwell/longplexpy/releases).


## Confirm the Docker Image was Built and Deployed
- Navigate to [Build and Deploy Action](https://github.com/seqwell/longplexpy/actions/workflows/build_and_deploy.yml)
- You should see two workflow runs with titles similar to the PR title, "chore(#.#.#): update pyproject version".
One should have a triggering event as the new tag "#.#.#" and one should have a triggering event as `main`.
- A green checkmark on these actions indicates the docker image was built, tagged, and pushed to the [seqwell/longplexpy](https://registry.hub.docker.com/r/seqwell/longplexpy) repo on Dockerhub.
11 changes: 9 additions & 2 deletions ci/docker-build-image
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ Ensure your Docker daemon is running with these minimum resource allocations:
Options:
-h Display this information.
-n Do not use the Docker cache during build. (Optional)
-p Push image to Dockerhub, requires docker login (Optional)
EOF
}

DOCKER_NO_CACHE="";
while getopts "hn" OPTION; do
DOCKER_NO_CACHE=""; PUSH_IMAGE=""
while getopts "hnp" OPTION; do
case "$OPTION" in
h) usage; exit 1;;
n) DOCKER_NO_CACHE="--no-cache";;
p) PUSH_IMAGE="True";;
[?]) usage; (>&2 echo "Exception: Unknown options ${*}."); exit 1;;
esac
done
Expand All @@ -47,3 +49,8 @@ LONGPLEXPY_VERSION="$(git describe --exact-match 2>/dev/null || git describe --a
--file docker/Dockerfile \
.
)

if [ -n "$PUSH_IMAGE" ];
then
docker push seqwell/longplexpy:"${LONGPLEXPY_VERSION}"
fi
Loading