Skip to content

Commit eb4979b

Browse files
committed
doc: add faq docs
- [x] faq on how to get repository id and discussion category id - [x] move checkout sooner in release image create - [x] add secrets for image registry, username, and password to release test Signed-off-by: jmeridth <[email protected]>
1 parent 718c117 commit eb4979b

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
run: |
103103
echo "image-registry-password secret is not set"
104104
exit 1
105+
- uses: actions/[email protected]
105106
- name: Set up Docker Buildx
106107
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
107108
- name: Log in to the Container registry
@@ -110,7 +111,6 @@ jobs:
110111
registry: ${{ env.IMAGE_REGISTRY }}
111112
username: ${{ env.IMAGE_REGISTRY_USERNAME }}
112113
password: ${{ env.IMAGE_REGISTRY_PASSWORD}}
113-
- uses: actions/[email protected]
114114
- name: Push Docker Image
115115
if: ${{ success() }}
116116
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
@@ -122,7 +122,7 @@ jobs:
122122
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:latest
123123
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:${{ needs.create_release.outputs.full-tag }}
124124
${{ env.IMAGE_REGISTRY }}/${{ inputs.image-name }}:${{ needs.create_release.outputs.short-tag }}
125-
platforms: linux/amd64
125+
platforms: linux/amd64,linux/arm64
126126
provenance: false
127127
sbom: false
128128
create_discussion:

.github/workflows/test-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ jobs:
1818
create-discussion: true
1919
secrets:
2020
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
image-registry: ghcr.io
22+
image-registry-username: ${{ github.actor }}
23+
image-registry-password: ${{ secrets.GITHUB_TOKEN }}
2124
discussion-repository-id: ${{ secrets.DISCUSSION_REPOSITORY_ID }}
2225
discussion-category-id: ${{ secrets.DISCUSSION_CATEGORY_ID }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM alpine
2+
CMD ["echo", "Hello World!!"]

docs/faq.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Frequently Asked Questions
2+
3+
## How to I get the repository ID to put in my Actions secrets for use with the reusable release workflow?
4+
5+
You can get a repository's ID via the GitHub Rest API endpoint](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository). I found using the `gh` CLI tool to be the easiest way to get the repository ID. You can use the following command to get the repository ID:
6+
7+
change the `OWNER` and `REPO` to the repository you are interested in.
8+
9+
```bash
10+
# GitHub CLI api
11+
# https://cli.github.com/manual/gh_api
12+
13+
gh api \
14+
-H "Accept: application/vnd.github+json" \
15+
-H "X-GitHub-Api-Version: 2022-11-28" \
16+
/repos/OWNER/REPO
17+
```
18+
19+
## How do I get the discussion category ID to put in my Actions secrets for use with the reusable release workflow?
20+
21+
You can get a repository's discussion category ID via the GitHub GraphQL API. You can use the [GraphQL Explorer UI Tool](https://docs.github.com/en/graphql/overview/explorer) to get the discussion category ID. You can use the following query to get the discussion category ID:
22+
23+
change the `owner` and `name` to the repository you are interested in.
24+
25+
```graphql
26+
query {
27+
repository(owner: "jmeridth", name: "reusable-workflows") {
28+
discussionCategories(first: 10) {
29+
nodes {
30+
# type: DiscussionCategory
31+
id
32+
name
33+
}
34+
}
35+
}
36+
}
37+
```

0 commit comments

Comments
 (0)