Skip to content

Commit dd7ca28

Browse files
committed
Add CI to build and push docker container
1 parent 2d58911 commit dd7ca28

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/main.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build-and-push
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
workflow_dispatch:
8+
9+
jobs:
10+
docker:
11+
runs-on: ubuntu-latest
12+
steps:
13+
-
14+
name: Set up QEMU
15+
uses: docker/setup-qemu-action@v2
16+
-
17+
name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
-
20+
name: Checkout code
21+
uses: actions/checkout@v4
22+
-
23+
name: Read version
24+
id: get_version
25+
run: |
26+
VERSION=$(cat VERSION | tr -d '\n')
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
-
29+
name: Login to DockerHub
30+
uses: docker/login-action@v2
31+
with:
32+
username: ${{ secrets.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_PASSWORD }}
34+
-
35+
name: Build and push
36+
uses: docker/build-push-action@v3
37+
with:
38+
context: .
39+
push: true
40+
tags: |
41+
${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
42+
${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ steps.get_version.outputs.version }}

0 commit comments

Comments
 (0)