-
Notifications
You must be signed in to change notification settings - Fork 36
40 lines (37 loc) · 1.19 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
name: Create and publish a Docker image
on:
push:
tags: [ "v[0-9]+*" ]
env:
REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
# only run on tag push
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v'))
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: udashframework
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Get version
id: get_tag_name
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build and push Docker image
run: >
sbt
'set ThisBuild/version := "${{ steps.get_tag_name.outputs.VERSION }}"'
'project guide-packager'
'set dockerRepository := Some("${{ env.REGISTRY }}")'
'set dockerUsername := Some("udashframework")'
docker:publish