ci: add actionlint for workflow validation
This commit is contained in:
parent
a98f2b09d0
commit
af2751ff61
3 changed files with 17 additions and 12 deletions
25
.github/workflows/docker_release.yml
vendored
25
.github/workflows/docker_release.yml
vendored
|
|
@ -52,21 +52,21 @@ jobs:
|
||||||
# workflow_dispatch uses the selected platforms input
|
# workflow_dispatch uses the selected platforms input
|
||||||
|
|
||||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
if [[ "${{ github.event_name }}" == "release" ]]; then
|
||||||
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"},{"platform":"linux/arm64","runner":"ubuntu-24.04-arm"}]}' >> $GITHUB_OUTPUT
|
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"},{"platform":"linux/arm64","runner":"ubuntu-24.04-arm"}]}' >> "$GITHUB_OUTPUT"
|
||||||
echo "is_multi_arch=true" >> $GITHUB_OUTPUT
|
echo "is_multi_arch=true" >> "$GITHUB_OUTPUT"
|
||||||
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||||
PLATFORMS="${{ inputs.platforms }}"
|
PLATFORMS="${{ inputs.platforms }}"
|
||||||
if [[ "$PLATFORMS" == *"arm64"* ]]; then
|
if [[ "$PLATFORMS" == *"arm64"* ]]; then
|
||||||
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"},{"platform":"linux/arm64","runner":"ubuntu-24.04-arm"}]}' >> $GITHUB_OUTPUT
|
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"},{"platform":"linux/arm64","runner":"ubuntu-24.04-arm"}]}' >> "$GITHUB_OUTPUT"
|
||||||
echo "is_multi_arch=true" >> $GITHUB_OUTPUT
|
echo "is_multi_arch=true" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"}]}' >> $GITHUB_OUTPUT
|
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"}]}' >> "$GITHUB_OUTPUT"
|
||||||
echo "is_multi_arch=false" >> $GITHUB_OUTPUT
|
echo "is_multi_arch=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Push to master - only amd64 for faster dev builds
|
# Push to master - only amd64 for faster dev builds
|
||||||
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"}]}' >> $GITHUB_OUTPUT
|
echo 'matrix={"include":[{"platform":"linux/amd64","runner":"ubuntu-latest"}]}' >> "$GITHUB_OUTPUT"
|
||||||
echo "is_multi_arch=false" >> $GITHUB_OUTPUT
|
echo "is_multi_arch=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
@ -79,9 +79,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
run: |
|
run: |
|
||||||
platform=${{ matrix.platform }}
|
platform="${{ matrix.platform }}"
|
||||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
echo "PLATFORM_PAIR=${platform//\//-}" >> "$GITHUB_ENV"
|
||||||
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|
@ -137,7 +137,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
run: |
|
run: |
|
||||||
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Download digests
|
- name: Download digests
|
||||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
|
|
@ -172,6 +172,7 @@ jobs:
|
||||||
- name: Create manifest list and push
|
- name: Create manifest list and push
|
||||||
working-directory: /tmp/digests
|
working-directory: /tmp/digests
|
||||||
run: |
|
run: |
|
||||||
|
# shellcheck disable=SC2046
|
||||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||||
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
docker-compose
|
docker-compose
|
||||||
opencode
|
opencode
|
||||||
typos
|
typos
|
||||||
|
actionlint
|
||||||
nodejs_22
|
nodejs_22
|
||||||
yarn
|
yarn
|
||||||
erlang_28
|
erlang_28
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,6 @@ pre-commit:
|
||||||
run: mix format --check-formatted
|
run: mix format --check-formatted
|
||||||
- name: typos
|
- name: typos
|
||||||
run: typos {staged_files}
|
run: typos {staged_files}
|
||||||
|
- name: actionlint
|
||||||
|
glob: '.github/workflows/*.{yml,yaml}'
|
||||||
|
run: actionlint {staged_files}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue