Skip to content

Commit 66f9366

Browse files
committed
👷 Add docker build
1 parent 4bd5c7f commit 66f9366

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

Diff for: .github/workflows/docker.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches: [ "main", "dev" ]
6+
tags: [ 'v*.*.*' ]
7+
pull_request:
8+
branches: ["dev"]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
id-token: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- uses: divideprojects/poetry-export-requirements-action@v1
27+
with:
28+
without-hashes: false
29+
outfile-name: requirements.txt
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/[email protected]
33+
34+
- name: Log into registry ${{ env.REGISTRY }}
35+
uses: docker/[email protected]
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract Docker metadata for
42+
id: meta
43+
uses: docker/[email protected]
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
tags: |
47+
type=ref,event=branch
48+
type=ref,event=pr
49+
type=ref,event=tag
50+
type=sha
51+
52+
- name: Build and push Docker image
53+
uses: docker/[email protected]
54+
with:
55+
context: .
56+
push: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)