-
Notifications
You must be signed in to change notification settings - Fork 57
53 lines (51 loc) · 2 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
skip_tests:
type: boolean
description: Skip the tests
required: true
default: false
push:
tags:
- 'v[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+-dockerupdate-[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-dockerupdate-[0-9]+'
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
run: docker build --target=build -t languagetool-build .
- name: Test
if: ${{ inputs.skip_tests == null || inputs.skip_tests == false }}
run: docker run languagetool-build mvn --projects languagetool-server clean test --also-make --errors
- name: Tag
run: |
echo 'DOCKER_TAG<<EOF' >> $GITHUB_ENV
echo $(echo ${{ github.ref }} | grep -oP '(?<=refs/tags/v).*') >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKERHUB_ACCESSTOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Push to Docker Hub
run: |
docker buildx build --push \
--tag $DOCKERHUB_REPOSITORY:$DOCKER_TAG \
--tag $DOCKERHUB_REPOSITORY:latest \
--platform linux/amd64,linux/arm64 .
env:
DOCKERHUB_REPOSITORY: erikvl87/languagetool
# - name: Push to GitHub Packages
# run: |
# docker tag languagetool docker.pkg.github.com/${{ github.repository }}/languagetool:$DOCKER_TAG
# docker tag languagetool docker.pkg.github.com/${{ github.repository }}/languagetool:latest
# docker login docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
# docker push docker.pkg.github.com/${{ github.repository }}/languagetool:$DOCKER_TAG