Update release.yml #5
Workflow file for this run
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
name: Docker Image CI | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Infer the version from the github ref | |
id: inferVersion | |
run: | | |
prefix="refs/tags/v" | |
if [[ ! "${GITHUB_REF}" == ${prefix}* ]]; then | |
echo "Unexpected GITHUB_REF: ${GITHUB_REF}" | |
exit 1 | |
fi | |
version="${GITHUB_REF:${#prefix}}" | |
echo "The version is: ${version}" | |
if [[ "${version}" == *"'"* ]]; then | |
echo "Unexpected version containing a single quote: ${version}" | |
exit 1 | |
fi | |
if [[ "${version}" == *'"'* ]]; then | |
echo "Unexpected version containing a double quote: ${version}" | |
exit 1 | |
fi | |
if [[ "${version}" == *':'* ]]; then | |
echo "Unexpected version containing a full colon: ${version}" | |
exit 1 | |
fi | |
echo "::set-output name=version::${version}" | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: | | |
cd capability-check-node-red | |
docker build -t capability-check-node-red:v${{ steps.inferVersion.outputs.version }} -f Dockerfile .. | |
- name: Export the Docker image | |
run: docker save -o capability-check-node-red_v${{ steps.inferVersion.outputs.version }}.tar capability-check-node-red:v${{ steps.inferVersion.outputs.version }} | |
- name: Upload the release assets | |
uses: Hs1r1us/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "v${{ steps.inferVersion.outputs.version }}" | |
asset_files: "capability-check-node-red/node-red-capability-check_v${{ steps.inferVersion.outputs.version }}.tar" |