|
3 | 3 | workflow_dispatch:
|
4 | 4 |
|
5 | 5 | jobs:
|
6 |
| - release: |
| 6 | + build: |
7 | 7 | runs-on: ubuntu-latest
|
8 | 8 | 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