-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (42 loc) · 1.19 KB
/
main.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
name: build-and-release
on:
push:
branches:
- '!*'
tags:
- 'v[0-9].*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Compute docker tags
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v5
with:
images: orangeopensource/credhub-exporter
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to DockerHub
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
- name: Create github release
id: create-github-release
if: success() && startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
Resource image available:
```
${{ steps.docker_meta.outputs.tags }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}