-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.63 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Docker
on:
push:
branches:
- main
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
apps: sbt scala
- name: Compile and prepare Docker configuration
run: sbt docker
env:
DISABLE_ASSERTIONS: 1
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
- name: Log in to the GitHub Container registry
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: michaelmior/jsonoid-server
tags: |
# semver tags
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: ./target/docker
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: ./target/docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}