Skip to content

Commit 471403d

Browse files
authored
Create docker-push-posthog.yml
1 parent 65a1f82 commit 471403d

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docker Push
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check Out Repo
13+
uses: actions/checkout@v2
14+
15+
- name: Login to Docker Hub
16+
uses: docker/login-action@v1
17+
with:
18+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
19+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
20+
21+
- name: Get Docker meta
22+
id: meta
23+
uses: docker/metadata-action@v3
24+
with:
25+
# list of Docker images to use as base name for tags
26+
images: |
27+
${{ secrets.DOCKER_HUB_USERNAME }}/posthog-deploy-posthog
28+
# generate Docker tags based on the following events/attributes
29+
tags: |
30+
type=semver,pattern={{version}}
31+
32+
- name: Set up Docker Buildx
33+
id: buildx
34+
uses: docker/setup-buildx-action@v1
35+
36+
- name: Build and push
37+
id: docker_build
38+
uses: docker/build-push-action@v2
39+
with:
40+
context: ./
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
44+
- name: Image digest
45+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)