Skip to content

Commit

Permalink
Optimization github action
Browse files Browse the repository at this point in the history
  • Loading branch information
text-adi committed Apr 4, 2024
1 parent 3fa0d50 commit f1d6588
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set test prefix
id: tag
id: image_tag
run: |
echo "test=${{ secrets.DOCKER_USERNAME }}/${{ vars.APP_NAME }}:${{ needs.vars.outputs.prefix-test }}" >> $GITHUB_OUTPUT
Expand All @@ -65,14 +65,14 @@ jobs:
provenance: false
target: local
tags: |
${{ steps.tag.outputs.test }}
${{ steps.image_tag.outputs.test }}
cache-to: type=gha,mode=max

- name: Get tool version
id: version
run: |
echo "kubectl=$(docker run --rm ${{ steps.tag.outputs.test }} kubectl version --client -o json | jq '.clientVersion.gitVersion' | tr -d 'v"')" >> $GITHUB_OUTPUT
echo "aws=$(docker run --rm ${{ steps.tag.outputs.test }} aws --version | cut -d' ' -f1 | cut -d'/' -f2)" >> $GITHUB_OUTPUT
echo "kubectl=$(docker run --rm ${{ steps.image_tag.outputs.test }} kubectl version --client -o json | jq '.clientVersion.gitVersion' | tr -d 'v"')" >> $GITHUB_OUTPUT
echo "aws=$(docker run --rm ${{ steps.image_tag.outputs.test }} aws --version | cut -d' ' -f1 | cut -d'/' -f2)" >> $GITHUB_OUTPUT
- name: Check kubectl and awscli version
run: |
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Create image tag
id: image_tag
run: |
echo "value=${{ secrets.DOCKER_USERNAME }}/${{ vars.APP_NAME }}:${{ steps.version.outputs.aws }}-${{ steps.version.outputs.kubectl }}" >> "$GITHUB_OUTPUT"
echo "basic=${{ secrets.DOCKER_USERNAME }}/${{ vars.APP_NAME }}:${{ steps.version.outputs.aws }}-${{ steps.version.outputs.kubectl }}" >> "$GITHUB_OUTPUT"
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
Expand All @@ -94,5 +94,5 @@ jobs:
provenance: false
target: local
tags: |
${{ steps.image_tag.outputs.value }}
${{ steps.image_tag.outputs.basic }}
cache-from: type=gha

0 comments on commit f1d6588

Please sign in to comment.