Skip to content

build

build #1574

Workflow file for this run

---
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
build-main:
# This job builds an image from the current main branch in the
# official repository.
# The resulting image is tagged with main and latest.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: imapfilter master and docker-imapfilterm ain
uses: docker/build-push-action@v6
with:
tags: ntnn/imapfilter:main,ntnn/imapfilter:latest
# Only push when building main
push: ${{ github.ref == 'refs/heads/main' }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
- id: imapfilter-latest-tag
run: |
# Can't find an endpoint that returns the latest tag - only
# the latest release. And since lefcha doesn't use GitHub's
# release feature the tags must be used.
tag="$(curl --location --silent https://api.github.com/repos/lefcha/imapfilter/tags | jq -r '.[].name' | head -1)"
echo "::set-output name=tag::$tag"
- name: imapfilter tag and docker-imapfilterm ain
uses: docker/build-push-action@v6
with:
tags: ntnn/imapfilter:latest-tag,ntnn/imapfilter:${{ steps.imapfilter-latest-tag.outputs.tag }}
# Only push when building main
push: ${{ github.ref == 'refs/heads/main' }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
imapfilter_spec=${{ steps.imapfilter-latest-tag.outputs.tag }}