Skip to content

Commit

Permalink
Merge pull request #117 from ImperialCollegeLondon/pre-release-tag
Browse files Browse the repository at this point in the history
Enable `pre-release` tag for published images
  • Loading branch information
AdrianDAlessandro authored Aug 2, 2024
2 parents d1a5be1 + 7de3def commit c69ca6e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on: [release]
on:
release:
types: [published]

jobs:
test:
Expand All @@ -19,6 +21,11 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{raw}}
type=raw,value=latest,enable=${{ !github.event.release.prerelease }}
type=raw,value=pre-release,enable=${{ github.event.release.prerelease }}
type=raw,value=stable,enable=${{ !github.event.release.prerelease && github.ref == 'refs/heads/main'}}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions run_pre_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 configure.py version pre-release
docker-compose up -d
2 changes: 1 addition & 1 deletion run_stable.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python3 configure.py version v0.3.2
python3 configure.py version stable
docker-compose up -d
7 changes: 7 additions & 0 deletions run_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if [ "$1" == "" ]; then
>&2 echo "You must provide a version number (i.e. v0.3.2) or tag (i.e. latest)"
exit 1
fi

python3 configure.py version $1
docker-compose up -d

0 comments on commit c69ca6e

Please sign in to comment.