forked from jeboehm/docker-mailserver
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Publish images based on the next branch
- Loading branch information
Showing
4 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
#!/bin/sh | ||
|
||
VERSION="${1}" | ||
COMPONENTS="mda mta db filter ssl virus web" | ||
|
||
if [ "${VERSION}" = "" ] | ||
then | ||
echo "Expected version string!" | ||
|
||
exit 1 | ||
fi | ||
|
||
for component in $COMPONENTS | ||
do | ||
docker tag jeboehm/mailserver-$component:latest jeboehm/mailserver-$component:$1 | ||
docker tag jeboehm/mailserver-$component:latest jeboehm/mailserver-$component:${VERSION} | ||
|
||
if [ "${VERSION}" != "next" ] | ||
then | ||
docker push jeboehm/mailserver-$component:latest | ||
fi | ||
|
||
docker push jeboehm/mailserver-$component:latest | ||
docker push jeboehm/mailserver-$component:$1 | ||
docker push jeboehm/mailserver-$component:${VERSION} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,48 @@ on: | |
push: | ||
branches: | ||
- main | ||
- next | ||
|
||
jobs: | ||
bump_version: | ||
publish_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare environment | ||
run: make .env | ||
|
||
- name: Build images | ||
run: make build | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.ref == 'refs/heads/main' | ||
|
||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
if: github.ref == 'refs/heads/main' | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Prepare environment | ||
- name: Push images (new tag) | ||
run: | | ||
cp .env.dist .env | ||
.ci/bin/push_image_version.sh ${{ steps.tag_version.outputs.new_tag }} | ||
if: github.ref == 'refs/heads/main' | ||
|
||
- name: Build and push images | ||
- name: Push images (next) | ||
run: | | ||
make build | ||
.ci/bin/push_image_version.sh ${{ steps.tag_version.outputs.new_tag }} | ||
.ci/bin/push_image_version.sh next | ||
if: github.ref == 'refs/heads/next' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters