-
Notifications
You must be signed in to change notification settings - Fork 32
81 lines (66 loc) · 2.2 KB
/
Copy pathtemplate-release.yml
File metadata and controls
81 lines (66 loc) · 2.2 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This runs the whole release workflow:
# * test the images
# * build and push them to the registries
# * create the GitHub release / discussion
name: Release
on:
workflow_call:
inputs:
directory:
description: Directory where the Dockerfile is
required: true
type: string
platforms:
description: The platforms to build on
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
description: Docker Hub username
required: true
DOCKERHUB_TOKEN:
description: Docker Hub token
required: true
jobs:
push:
permissions:
packages: write
uses: ./.github/workflows/template-push.yml
secrets: inherit
with:
directory: ${{ inputs.directory }}
platforms: ${{ inputs.platforms }}
release:
runs-on: ubuntu-latest
needs:
- push
permissions:
contents: write
discussions: write
steps:
- uses: actions/checkout@v7
- name: Metadata
id: meta
working-directory: ${{ inputs.directory }}
run: |
echo "nomad=$(cat nomad-version)" >> "$GITHUB_OUTPUT"
echo "git=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "pretty-platforms=$(echo ${{ inputs.platforms }} | sed 's/,/`, `/g')" >> "$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
discussion_category_name: announcements
name: Nomad ${{ steps.meta.outputs.nomad }}
body: |
[Nomad ${{ steps.meta.outputs.nomad }}](https://github.com/hashicorp/nomad/releases/tag/v${{ steps.meta.outputs.nomad }})
Pull the image from:
* [GitHub Packages](https://github.com/multani/docker-nomad/pkgs/container/nomad):
```shell
docker pull ghcr.io/multani/nomad:${{ steps.meta.outputs.git }}
```
* [Docker Hub](https://hub.docker.com/r/multani/nomad/):
```shell
docker pull multani/nomad:${{ steps.meta.outputs.git }}
```
The image is available on the following platforms: `${{ steps.meta.outputs.pretty-platforms }}`.