Skip to content

Commit 35a0692

Browse files
authored
Merge pull request #842 from jmrenouard/add-docker-publish-workflow
feat: add github action to build and push docker image
2 parents 58a8c4a + e1d9c15 commit 35a0692

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker Publish
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Log in to Docker Hub
16+
uses: docker/login-action@v2
17+
with:
18+
username: ${{ secrets.DOCKER_USER_LOGIN }}
19+
password: ${{ secrets.DOCKER_USER_PASSWORD }}
20+
21+
- name: Extract version from mysqltuner.pl
22+
id: version
23+
run: echo "VERSION=$(grep '\- Version ' mysqltuner.pl | awk '{ print $NF}')" >> $GITHUB_ENV
24+
25+
- name: Build and push Docker image
26+
uses: docker/build-push-action@v4
27+
with:
28+
context: .
29+
push: true
30+
tags: |
31+
jmrenouard/mysqltuner:latest
32+
jmrenouard/mysqltuner:${{ env.VERSION }}

0 commit comments

Comments
 (0)