-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 'Documentation' | ||
description: 'build with mdBook and optionally push' | ||
inputs: | ||
publish: | ||
description: 'push resulting files to gh-pages' | ||
default: 'true' | ||
token: | ||
description: 'github token' | ||
default: ${{ github.token }} | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: peaceiris/actions-mdbook@v1 | ||
with: | ||
mdbook-version: 'latest' | ||
- shell: sh | ||
run: | | ||
d="$(echo "${GITHUB_REF#refs/tags/}" | sed '/^refs\/heads\//d')" | ||
if test -z "$d"; then | ||
exec mdbook build | ||
else | ||
exec mdbook build --dest-dir "./book/${d}" | ||
fi | ||
- uses: peaceiris/actions-gh-pages@v3 | ||
# This conditional doesn't exist yet. | ||
if: ${{ inputs.publish }} | ||
with: | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
github_token: ${{ inputs.token }} | ||
publish_dir: ./book | ||
keep_files: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Set Image Expiration' | ||
description: 'Use the Quay API to set an expiration time on an image' | ||
inputs: | ||
quay: | ||
description: 'Quay instance to issue calls to.' | ||
required: false | ||
default: 'quay.io' | ||
duration: | ||
description: 'Duration (in seconds) into the future to expire the image.' | ||
required: false | ||
default: 1209600 | ||
repo: | ||
description: 'Namespace & repository' | ||
required: true | ||
tag: | ||
description: 'image tag' | ||
required: true | ||
token: | ||
description: 'API token' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- id: add-mask | ||
shell: sh | ||
run: | | ||
printf '::add-mask::%s\n' "${{ inputs.token }}" | ||
- id: write-script | ||
shell: sh | ||
run: | | ||
jq -n -c --argjson e "$(($(date -u +%s) + ${{ inputs.duration }}))" '{expiration: $e}' > "${RUNNER_TEMP}/expiration.json" | ||
cat <<. >"${RUNNER_TEMP}/run" | ||
#!/usr/bin/env -S curl -K | ||
silent | ||
show-error | ||
fail-with-body | ||
data-binary="@${RUNNER_TEMP}/expiration.json" | ||
header="Authorization: Bearer ${{ inputs.token }}" | ||
header="Content-Type: application/json" | ||
header="Accept: application/json" | ||
request=PUT | ||
url="https://${{ inputs.quay }}/api/v1/repository/${{ inputs.repo }}/tag/${{ inputs.tag }}" | ||
. | ||
chmod +x "${RUNNER_TEMP}/run" | ||
- id: call | ||
shell: sh | ||
run: '${RUNNER_TEMP}/run' |