2022-09-06 19:29:12 +03:00
|
|
|
name: Build Private Images
|
2020-12-29 17:01:10 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-09-06 19:29:12 +03:00
|
|
|
branches: [master, stable]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
types: [synchronize, labeled]
|
2020-12-29 17:01:10 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-09-06 19:29:12 +03:00
|
|
|
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'deploy-to-staging') }}
|
2021-12-08 16:57:15 +03:00
|
|
|
runs-on: buildjet-4vcpu-ubuntu-2004
|
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
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
2022-09-06 19:29:12 +03:00
|
|
|
images: plausible/analytics-private
|
2022-05-27 14:09:57 +03:00
|
|
|
tags: |
|
2022-09-06 19:29:12 +03:00
|
|
|
type=ref,event=pr
|
2022-05-27 14:09:57 +03:00
|
|
|
type=ref,event=branch
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2020-12-29 17:01:10 +03:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2022-05-27 14:09:57 +03:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
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
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
2022-09-06 19:29:12 +03:00
|
|
|
push: true
|
2022-05-27 14:09:57 +03:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
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: |
|
|
|
|
BUILD_METADATA=${{ steps.meta.outputs.json }}
|
|
|
|
|
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 }}
|