-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update f2b-exporter to 0.9, add publish workflow
Signed-off-by: Thilo Fromm <[email protected]>
- Loading branch information
Showing
3 changed files
with
68 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and Publish the mailserver Docker Image to GHCR.io | ||
|
||
# Manually-triggered action to build the latest version (or optionally, if provided, a release tag) | ||
# of mailserver. | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_tag: | ||
description: Optional version tag to build. Defaults to latest main. | ||
required: false | ||
tag_as_latest: | ||
description: Also tag image as latest (in addition to tag supplied / computed). | ||
type: boolean | ||
default: 0 | ||
|
||
jobs: | ||
build_and_publish_image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: mailserver | ||
fetch-depth: 0 | ||
|
||
- name: Optionally Check Out Tag | ||
if: ${{ inputs.version_tag }} | ||
# work around https://github.com/actions/runner/issues/665 | ||
shell: bash | ||
env: | ||
VERSION_TAG: ${{ inputs.version_tag }} | ||
run: | | ||
cd mailserver | ||
git checkout "$VERSION_TAG" | ||
- name: Grok image tag | ||
run: | | ||
cd mailserver | ||
git describe --tags | tee SRC_TAG | ||
echo "ghcr.io/t-lo/mailserver:$(cat SRC_TAG)-models" | tee IMAGE_TAG | ||
- name: Build the docker image | ||
run: | | ||
cd mailserver | ||
tag=$(cat IMAGE_TAG) | ||
docker build -t "$(cat IMAGE_TAG)" . | ||
- name: Login to GHCR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push Image | ||
run: | | ||
docker push "$(cat mailserver/IMAGE_TAG)" | ||
- name: Optionally Tag Image as Latest | ||
if: ${{ inputs.tag_as_latest }} | ||
run: | | ||
docker tag "$(cat mailserver/IMAGE_TAG)" ghcr.io/t-lo/mailserver:latest | ||
docker push ghcr.io/t-lo/mailserver:latest |
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