lc-core/.github/workflows/docker-latest.yml

60 lines
1.4 KiB
YAML
Raw Normal View History

2021-04-01 02:58:19 -04:00
name: Update docker image
on:
push:
2021-04-01 03:00:28 -04:00
branches: [ master ]
2021-12-09 22:58:05 -05:00
tags:
- 'v*'
2021-04-01 02:58:19 -04:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
2021-04-01 03:01:51 -04:00
java-version: 1.16
2021-04-01 02:58:19 -04:00
- name: Assemble Jar
run: sbt assembly
2021-12-09 22:57:07 -05:00
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: librecaptcha/lc-core
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
2021-04-01 02:58:19 -04:00
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
2021-04-01 02:58:19 -04:00
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Runner.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
2021-12-09 22:57:07 -05:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2021-04-01 02:58:19 -04:00
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}