Skip to content

Commit

Permalink
fix syntax on access of named variables
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSebastian committed Apr 7, 2024
1 parent accfc7e commit 7f5a3bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/create-ghcr-image-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/[email protected]
id: tagName
id: getTagNameParts
with:
tagRegex: (?<service>.*)\/v(?<version>.*) #example: backend/v1.2.3
tagRegexGroup: 0

- name: show-service
env:
ghRef: ${{ github.ref }}
service: ${{ steps.tagName.outputs.service }}
version: ${{ steps.tagName.outputs.version }}
tagFromAction: ${{ steps.tagName.outputs.tag }}
service: ${{ steps.getTagNameParts.outputs.service }}
version: ${{ steps.getTagNameParts.outputs.version }}
tagFromAction: ${{ steps.getTagNameParts.outputs.tag }}
run: |
echo "Ref: $ghRef"
echo "Service: $service"
Expand All @@ -36,10 +36,10 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v4
env:
service: ${{ steps.tagName.outputs.service }}
service: ${{ steps.getTagNameParts.outputs.service }}
with:
cache: 'maven'
cache-dependency-path: '${{ service }}/pom.xml'
cache-dependency-path: ${{ steps.getTagNameParts.outputs.service }}/pom.xml
java-version: '17'
distribution: 'temurin'

Expand All @@ -57,25 +57,22 @@ jobs:
id: meta
uses: docker/metadata-action@v5
env:
service: ${{ steps.tagName.outputs.service }}
image: ${{ env.REGISTRY }}/${{ github.repository }}-${{ service }}
tagDefinitionMajorOnly: "type=match,pattern=(${{ service }})/v(\\d).\\d.\\d,group=2"
tagDefinitionMajorMinor: "type=match,pattern=(${{ service }})/v(\\d.\\d).\\d,group=2"
tagDefinitionFullVersion: "type=match,pattern=(${{ service }})/v(.*),group=2"
image: ${{ env.REGISTRY }}/${{ github.repository }}-${{ steps.getTagNameParts.outputs.service }}
tagDefinitionMajorOnly: type=match,pattern=(${{ steps.getTagNameParts.outputs.service }})/v(\d).\d.\d,group=2
tagDefinitionMajorMinor: type=match,pattern=(${{ steps.getTagNameParts.outputs.service }})/v(\d.\d).\d,group=2
tagDefinitionFullVersion: type=match,pattern=(${{ steps.getTagNameParts.outputs.service }})/v(.*),group=2
with:
images: ${{ image }}
tags: |
${{ tagDefinitionMajorOnly }}
${{ tagDefinitionMajorMinor }}
${{ tagDefinitionFullVersion }}
$tagDefinitionMajorOnly
$tagDefinitionMajorMinor
$tagDefinitionFullVersion
type=raw,value=latest
- name: Build and push image
uses: docker/build-push-action@v5
env:
service: ${{ steps.tagName.outputs.service }}
with:
context: ./${{ service }}
context: ./${{ steps.getTagNameParts.outputs.service }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
16 changes: 6 additions & 10 deletions .github/workflows/create-release-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/[email protected]
id: tagName
id: getTagNameParts
with:
tagRegex: (?<service>.*)\/v(?<version>.*) #example: backend/v1.2.3
tagRegexGroup: 0

- name: show-service
env:
ghRef: ${{ github.ref }}
service: ${{ steps.tagName.outputs.service }}
version: ${{ steps.tagName.outputs.version }}
tagFromAction: ${{ steps.tagName.outputs.tag }}
service: ${{ steps.getTagNameParts.outputs.service }}
version: ${{ steps.getTagNameParts.outputs.version }}
tagFromAction: ${{ steps.getTagNameParts.outputs.tag }}
run: |
echo "Ref: $ghRef"
echo "Service: $service"
Expand All @@ -35,11 +35,9 @@ jobs:

- name: Set up JDK 17
uses: actions/setup-java@v4
env:
service: ${{ steps.tagName.outputs.service }}
with:
cache: 'maven'
cache-dependency-path: '${{ service }}/pom.xml'
cache-dependency-path: '${{ steps.getTagNameParts.outputs.service }}/pom.xml'
java-version: '17'
distribution: 'temurin'

Expand All @@ -48,12 +46,10 @@ jobs:

- name: Create GitHub Release
id: create_release
env:
service: ${{ steps.tagName.outputs.service }}
uses: softprops/action-gh-release@v1
with:
files: |
${{ service }}/target/*.jar
${{ steps.getTagNameParts.outputs.service }}/target/*.jar
draft: false
prerelease: false
generate_release_notes: false

0 comments on commit 7f5a3bd

Please sign in to comment.