Skip to content

Commit

Permalink
add proper release action
Browse files Browse the repository at this point in the history
  • Loading branch information
tboeghk committed Dec 7, 2023
1 parent 8df66c9 commit 43a23b8
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dockerhub-description.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update Docker Hub Description
on:
workflow_dispatch:
push:
branches:
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml

jobs:
dockerhub-description:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: observabilitystack/tls-grade-exporter
short-description: ${{ github.event.repository.description }}
87 changes: 61 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,66 @@ on:
workflow_dispatch:

jobs:
release:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
with:
submodules: recursive

- name: build Docker file
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/ping7io/tls-grade-exporter:latest

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4

- id: determine-tag-and-build-date
name: Determine Docker tag
run: |
echo build_tag=$(date +%Y-%W) >> $GITHUB_ENV
echo build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_ENV
- name: Build and push to DockerHub registry
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
build-args: |
CREATED_AT=${{ env.build_date }}
VERSION=${{ env.build_tag }}
GIT_REVISION=${{ github.sha }}
tags: |
observabilitystack/tls-grade-exporter:${{ env.build_tag }}
observabilitystack/tls-grade-exporter:latest
ghcr.io/${{ github.repository }}:${{ env.build_tag }}
ghcr.io/${{ github.repository }}:latest
create-release:
runs-on: ubuntu-latest
needs: build
steps:

- uses: actions/checkout@v4

- id: determine-tag
name: Determine Docker tag
run: echo "::set-output name=tag::$(date +%Y-%V)"

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.determine-tag.outputs.tag }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 43a23b8

Please sign in to comment.