Skip to content

Commit d75b0e2

Browse files
authored
Create docker-image.yml
1 parent 5b2806a commit d75b0e2

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Dockerize
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "*"
9+
workflow_dispatch:
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v4
20+
with:
21+
images: inseefrlab/cloudbeaver
22+
tags: |
23+
# set latest tag for main branch
24+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
25+
# propagate valid semver tags
26+
type=semver,pattern={{raw}}
27+
- name: Login to DockerHub
28+
if: github.event_name != 'pull_request'
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
- name: Build and push
34+
uses: docker/build-push-action@v4
35+
with:
36+
context: .
37+
push: ${{ github.event_name != 'pull_request' }}
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)