Skip to content

Commit 453df8c

Browse files
author
n.fraison
committed
Update github actions
1 parent 12aafdc commit 453df8c

File tree

2 files changed

+58
-42
lines changed

2 files changed

+58
-42
lines changed

.github/workflows/release.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Releases
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up JDK 1.8
14+
uses: actions/setup-java@v1
15+
with:
16+
java-version: 1.8
17+
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
21+
- name: Build with Gradle
22+
run: ./gradlew build
23+
24+
- name: Release
25+
uses: fnkr/github-action-ghr@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
GHR_PATH: "build/libs/"
29+
30+
- name: Generate Docker metadata
31+
id: meta
32+
uses: docker/metadata-action@v3
33+
with:
34+
images: |
35+
criteord/cassandra_exporter
36+
tags: |
37+
type=ref,event=branch
38+
type=semver,pattern={{version}}
39+
type=semver,pattern={{major}}.{{minor}}
40+
flavor: |
41+
latest=true
42+
43+
- name: Login to Docker Hub
44+
uses: docker/login-action@v1
45+
with:
46+
username: ${{ secrets.DOCKER_USERNAME }}
47+
password: ${{ secrets.DOCKER_PASSWORD }}
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v1
51+
52+
- name: Build and push
53+
uses: docker/build-push-action@v2
54+
with:
55+
context: .
56+
file: docker/Dockerfile
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/releases.yml

-42
This file was deleted.

0 commit comments

Comments
 (0)