Skip to content

Commit 43a23b8

Browse files
committed
add proper release action
1 parent 8df66c9 commit 43a23b8

File tree

2 files changed

+84
-26
lines changed

2 files changed

+84
-26
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Update Docker Hub Description
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- README.md
9+
- .github/workflows/dockerhub-description.yml
10+
11+
jobs:
12+
dockerhub-description:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Update Docker Hub description
18+
uses: peter-evans/dockerhub-description@v3
19+
with:
20+
username: ${{ secrets.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
repository: observabilitystack/tls-grade-exporter
23+
short-description: ${{ github.event.repository.description }}

.github/workflows/release.yaml

Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,66 @@ on:
33
workflow_dispatch:
44

55
jobs:
6-
release:
6+
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Set up QEMU
10-
uses: docker/setup-qemu-action@v3
11-
12-
- name: Set up Docker Buildx
13-
uses: docker/setup-buildx-action@v3
14-
15-
- name: Log in to GitHub Docker Registry
16-
uses: docker/login-action@v3
17-
with:
18-
registry: ghcr.io
19-
username: ${{ github.actor }}
20-
password: ${{ secrets.GITHUB_TOKEN }}
21-
22-
- uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
25-
26-
- name: build Docker file
27-
uses: docker/build-push-action@v5
28-
with:
29-
context: .
30-
platforms: linux/amd64,linux/arm64
31-
push: true
32-
tags: |
33-
ghcr.io/ping7io/tls-grade-exporter:latest
9+
10+
- name: Set up QEMU
11+
uses: docker/setup-qemu-action@v3
12+
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v3
15+
16+
- name: Login to DockerHub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Log in to GitHub Docker Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- uses: actions/checkout@v4
30+
31+
- id: determine-tag-and-build-date
32+
name: Determine Docker tag
33+
run: |
34+
echo build_tag=$(date +%Y-%W) >> $GITHUB_ENV
35+
echo build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_ENV
36+
37+
- name: Build and push to DockerHub registry
38+
uses: docker/build-push-action@v5
39+
with:
40+
platforms: linux/amd64,linux/arm64
41+
push: true
42+
build-args: |
43+
CREATED_AT=${{ env.build_date }}
44+
VERSION=${{ env.build_tag }}
45+
GIT_REVISION=${{ github.sha }}
46+
tags: |
47+
observabilitystack/tls-grade-exporter:${{ env.build_tag }}
48+
observabilitystack/tls-grade-exporter:latest
49+
ghcr.io/${{ github.repository }}:${{ env.build_tag }}
50+
ghcr.io/${{ github.repository }}:latest
51+
52+
create-release:
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
57+
- uses: actions/checkout@v4
58+
59+
- id: determine-tag
60+
name: Determine Docker tag
61+
run: echo "::set-output name=tag::$(date +%Y-%V)"
62+
63+
- name: Create Release
64+
uses: ncipollo/release-action@v1
65+
with:
66+
tag: ${{ steps.determine-tag.outputs.tag }}
67+
allowUpdates: true
68+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)