2020-08-30 23:33:21 +02:00
|
|
|
name: Build Apprise API Image
|
2020-08-30 23:30:17 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-08-30 23:33:21 +02:00
|
|
|
branches: master
|
2020-08-30 23:30:17 +02:00
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildx:
|
2023-05-16 18:29:01 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-08-30 23:30:17 +02:00
|
|
|
steps:
|
2021-02-24 01:00:32 +01:00
|
|
|
- name: Checkout
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: actions/checkout@v4
|
2020-08-30 23:30:17 +02:00
|
|
|
|
2021-02-24 01:00:32 +01:00
|
|
|
- name: Docker meta
|
|
|
|
id: docker_meta
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: docker/metadata-action@v5
|
2021-02-24 01:00:32 +01:00
|
|
|
with:
|
2023-11-15 03:46:31 +01:00
|
|
|
images: |
|
|
|
|
docker.io/caronc/apprise
|
|
|
|
tags: |
|
|
|
|
type=semver,event=tag,pattern={{version}}
|
|
|
|
type=semver,event=tag,pattern={{major}}.{{minor}}
|
|
|
|
type=edge,branch=master
|
2021-02-24 01:00:32 +01:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2020-08-30 23:30:17 +02:00
|
|
|
|
2021-02-24 01:00:32 +01:00
|
|
|
- name: Set up Docker Buildx
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Check pushing to Docker Hub
|
|
|
|
id: push-other-places
|
|
|
|
# Only push to Dockerhub from the main repo
|
|
|
|
# Otherwise forks would require a Docker Hub account and secrets setup
|
|
|
|
run: |
|
|
|
|
if [[ ${{ github.repository_owner }} == "caronc" ]] ; then
|
|
|
|
echo "Enabling DockerHub image push"
|
|
|
|
echo "enable=true" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "Not pushing to DockerHub"
|
|
|
|
echo "enable=false" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
2020-08-30 23:30:17 +02:00
|
|
|
|
2021-02-24 01:00:32 +01:00
|
|
|
- name: Login to DockerHub
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: docker/login-action@v3
|
|
|
|
# Don't attempt to login is not pushing to Docker Hub
|
|
|
|
if: steps.push-other-places.outputs.enable == 'true'
|
2020-08-30 23:30:17 +02:00
|
|
|
with:
|
2021-02-24 01:39:02 +01:00
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2021-02-24 01:00:32 +01:00
|
|
|
|
|
|
|
- name: Build and push
|
2023-11-15 03:46:31 +01:00
|
|
|
uses: docker/build-push-action@v5
|
2021-02-24 01:00:32 +01:00
|
|
|
with:
|
|
|
|
context: .
|
2023-07-07 03:38:15 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2021-02-24 01:00:32 +01:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|