Skip to content

Commit 4018c16

Browse files
committed
Add docker publishing workflow
1 parent c9f5884 commit 4018c16

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
pull_request:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Extract Docker image metadata
20+
id: meta
21+
uses: docker/metadata-action@v5
22+
with:
23+
images: ${{ vars.DOCKER_USERNAME }}/population-app
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ vars.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_TOKEN }}
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v6
36+
with:
37+
push: ${{ github.event_name != 'pull_request' }}
38+
tags: ${{ steps.meta.outputs.tags }}
39+
annotations: ${{ steps.meta.outputs.annotations }}
40+
provenance: true
41+
sbom: true

0 commit comments

Comments
 (0)