|
|
|
|
@ -2,9 +2,10 @@ name: Build
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [ master, stable, dev ]
|
|
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
branches: [master, stable, dev]
|
|
|
|
|
tags: ['v*']
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
@ -18,17 +19,23 @@ jobs:
|
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
|
|
|
id: extract_branch
|
|
|
|
|
|
|
|
|
|
- name: Prepeare release
|
|
|
|
|
shell: bash
|
|
|
|
|
run: ./rel/prepare_release.sh ${{ steps.extract_branch.outputs.branch }}
|
|
|
|
|
id: prepare_release
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
|
- name: Docker meta
|
|
|
|
|
id: meta
|
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
|
with:
|
|
|
|
|
images: plausible/analytics
|
|
|
|
|
tags: |
|
|
|
|
|
type=ref,event=branch
|
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
-
|
|
|
|
|
name: Login to DockerHub
|
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
@ -38,8 +45,10 @@ jobs:
|
|
|
|
|
id: docker_build
|
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
|
with:
|
|
|
|
|
push: true
|
|
|
|
|
tags: plausible/analytics:${{ steps.extract_branch.outputs.branch }}
|
|
|
|
|
context: .
|
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
cache-from: type=registry,ref=plausible/analytics:${{ steps.extract_branch.outputs.branch }}
|
|
|
|
|
cache-to: type=inline
|
|
|
|
|
-
|
|
|
|
|
|