Some checks failed
Publish nx-webmail Image / publish (push) Has been cancelled
70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Publish nx-webmail Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "nx-webmail/**"
|
|
- ".github/workflows/publish-nx-webmail-image.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Read app version
|
|
id: meta
|
|
shell: bash
|
|
run: |
|
|
version=$(grep '^version:' nx-webmail/umbrel-app.yml | awk -F'"' '{print $2}')
|
|
if [ -z "$version" ]; then
|
|
echo "Could not read nx-webmail version from umbrel-app.yml" >&2
|
|
exit 1
|
|
fi
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
echo "image=ghcr.io/weektab/nx-webmail" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push image
|
|
id: build
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./nx-webmail
|
|
file: ./nx-webmail/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}
|
|
${{ steps.meta.outputs.image }}:latest
|
|
|
|
- name: Summary
|
|
shell: bash
|
|
run: |
|
|
{
|
|
echo "### nx-webmail image published"
|
|
echo ""
|
|
echo "- Image: \`${{ steps.meta.outputs.image }}\`"
|
|
echo "- Version tag: \`${{ steps.meta.outputs.version }}\`"
|
|
echo "- Digest: \`${{ steps.build.outputs.digest }}\`"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|