2022-09-06 19:29:12 +03:00
|
|
|
name: Build Public Images
|
2020-12-29 17:01:10 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-05-27 14:09:57 +03:00
|
|
|
tags: ['v*']
|
2020-12-29 17:01:10 +03:00
|
|
|
|
2023-09-20 15:06:04 +03:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-12-29 17:01:10 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
2024-08-27 12:06:12 +03:00
|
|
|
runs-on: ubuntu-latest
|
2020-12-29 17:31:48 +03:00
|
|
|
|
2020-12-29 17:01:10 +03:00
|
|
|
steps:
|
2022-05-27 14:09:57 +03:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2023-09-18 10:57:05 +03:00
|
|
|
uses: docker/metadata-action@v5
|
2022-05-27 14:09:57 +03:00
|
|
|
with:
|
2024-02-23 14:17:45 +03:00
|
|
|
images: plausible/community-edition
|
2022-05-27 14:09:57 +03:00
|
|
|
tags: |
|
2022-10-19 15:09:09 +03:00
|
|
|
type=semver,pattern={{version}},prefix=v
|
|
|
|
type=semver,pattern={{major}}.{{minor}},prefix=v
|
|
|
|
type=semver,pattern={{major}},prefix=v
|
2022-05-27 14:09:57 +03:00
|
|
|
|
2022-09-26 16:11:30 +03:00
|
|
|
- name: Set up QEMU
|
2023-09-18 10:53:19 +03:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-09-26 16:11:30 +03:00
|
|
|
|
2022-05-27 14:09:57 +03:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-18 10:58:42 +03:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-05-27 14:09:57 +03:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2023-09-18 10:54:04 +03:00
|
|
|
uses: docker/login-action@v3
|
2020-12-29 17:01:10 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2020-12-29 17:31:48 +03:00
|
|
|
|
2022-05-27 14:30:21 +03:00
|
|
|
- name: Build and push
|
2020-12-29 17:01:10 +03:00
|
|
|
id: docker_build
|
2024-06-24 11:41:56 +03:00
|
|
|
uses: docker/build-push-action@v6
|
2020-12-29 17:01:10 +03:00
|
|
|
with:
|
2022-10-11 14:35:34 +03:00
|
|
|
push: true
|
2022-05-27 14:09:57 +03:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-09-26 16:11:30 +03:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2022-05-27 14:30:21 +03:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2022-05-27 15:24:11 +03:00
|
|
|
build-args: |
|
2024-04-29 09:05:33 +03:00
|
|
|
MIX_ENV=ce
|
2022-05-27 15:24:11 +03:00
|
|
|
BUILD_METADATA=${{ steps.meta.outputs.json }}
|
2024-03-08 17:33:55 +03:00
|
|
|
ERL_FLAGS=+JMsingle true
|
2022-05-27 15:24:11 +03:00
|
|
|
|
2022-05-27 14:30:21 +03:00
|
|
|
- name: Image digest
|
2020-12-29 17:01:10 +03:00
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
2022-10-13 17:41:05 +03:00
|
|
|
|
|
|
|
- name: Notify team on failure
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: fjogeleit/http-request-action@v1
|
|
|
|
with:
|
|
|
|
url: ${{ secrets.BUILD_NOTIFICATION_URL }}
|
|
|
|
method: 'POST'
|
|
|
|
customHeaders: '{"Content-Type": "application/json"}'
|
|
|
|
data: '{"content": "<a href=\"https://github.com/plausible/analytics/actions/workflows/build-public-images.yml\">Build failed</a>"}'
|