Skip to content

Commit

Permalink
💚 Fix use of steps instead of env
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo-Barreto committed Dec 31, 2024
1 parent 7440672 commit f9cc825
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ jobs:
- name: Extract Version for Dev Build
id: versioning
run: |
branch_name=${{ github.head_ref }}
branch_name=${{ github.ref_name }}
if [[ "$branch_name" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version=${branch_name#v}
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version}-dev" >> $GITHUB_ENV
echo "version=$version" >> $GITHUB_OUTPUT
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version}" >> $GITHUB_OUTPUT
else
echo "Error: Branch name must follow 'vx.y.z' pattern." >&2
exit 1
Expand All @@ -45,6 +46,6 @@ jobs:
with:
context: .
push: true
tags: ${{ env.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ env.version }}-dev
tags: ${{ steps.versioning.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ steps.versioning.outputs.version }}
cache-to: type=inline
7 changes: 4 additions & 3 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
branch_name=${{ github.head_ref }}
if [[ "$branch_name" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version=${branch_name#v}
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version},thunderatz/stm32cubemx:${version}" >> $GITHUB_ENV
echo "version=$version" >> $GITHUB_OUTPUT
echo "tags=ghcr.io/thunderatz/stm32cubemx:${version},thunderatz/stm32cubemx:${version}" >> $GITHUB_OUTPUT
else
echo "Error: Branch name must follow 'vx.y.z' pattern." >&2
exit 1
Expand All @@ -52,6 +53,6 @@ jobs:
with:
context: .
push: true
tags: ${{ env.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ env.version }}
tags: ${{ steps.versioning.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/thunderatz/stm32cubemx:${{ steps.versioning.outputs.version }}
cache-to: type=inline

0 comments on commit f9cc825

Please sign in to comment.