2020-12-29 17:31:48 +03:00
|
|
|
name: Build
|
2020-12-29 17:01:10 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-12-29 17:31:48 +03:00
|
|
|
branches: [ master, stable ]
|
2020-12-29 17:01:10 +03:00
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-29 17:31:48 +03:00
|
|
|
|
2020-12-29 17:01:10 +03:00
|
|
|
steps:
|
2020-12-29 17:31:48 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-12-29 17:44:36 +03:00
|
|
|
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
|
|
id: extract_branch
|
2020-12-29 17:31:48 +03:00
|
|
|
|
2020-12-29 17:01:10 +03:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2020-12-29 17:31:48 +03:00
|
|
|
|
2020-12-29 17:01:10 +03:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
push: true
|
2020-12-29 17:44:36 +03:00
|
|
|
tags: plausible/analytics:${{ steps.extract_branch.outputs.branch }}
|
|
|
|
cache-from: type=registry,ref=plausible/analytics:${{ steps.extract_branch.outputs.branch }}
|
2020-12-29 17:41:19 +03:00
|
|
|
cache-to: type=inline
|
2020-12-29 17:01:10 +03:00
|
|
|
-
|
|
|
|
name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|