Skip to content

Commit e1ff4c9

Browse files
committed
ci: Fix workflow
1 parent dd3f660 commit e1ff4c9

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

.github/workflows/build-push.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ jobs:
1919
- name: Set up Docker Buildx
2020
uses: docker/setup-buildx-action@v3
2121

22-
- name: Extract branch name
22+
- name: Extract tag name
2323
shell: bash
24-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | sed 's#/#_#g')"
24+
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/} | sed 's#/#_#g')"
2525
id: extract_refs
2626

27-
- name: Debug branch name
28-
run: echo "${{ steps.extract_refs.outputs.branch }}"
29-
3027
- name: Cache Docker layers
3128
uses: actions/cache@v4
3229
with:
@@ -39,12 +36,12 @@ jobs:
3936
uses: docker/build-push-action@v5
4037
with:
4138
context: .
42-
tags: ${{ vars.ECS_REPOSITORY_NAME }}:${{ github.ref }}
39+
tags: ${{ vars.ECS_REPOSITORY_NAME }}:${{ steps.extract_refs.outputs.tag }}
4340
load: true
4441
cache-from: type=local,src=/tmp/.buildx-cache
4542
cache-to: type=local,dest=/tmp/.buildx-cache-new
4643
build_args: |
47-
RUBY_VERSION=${{ github.ref }}
44+
RUBY_VERSION=${{ steps.extract_refs.outputs.tag }}
4845
4946
- name: Push Image to Amazon ECR
5047
id: ecr_sha_ruby
@@ -54,7 +51,7 @@ jobs:
5451
secret-access-key: ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }}
5552
region: eu-west-1
5653
local-image: ${{ vars.ECS_REPOSITORY_NAME }}:${{ github.ref }}
57-
image: ${{ vars.ECS_REPOSITORY_NAME }}:${{ github.ref }}, ${{ vars.ECS_REPOSITORY_NAME }}:${{ steps.extract_refs.outputs.branch }}
54+
image: ${{ vars.ECS_REPOSITORY_NAME }}:${{ steps.extract_refs.outputs.tag }}
5855

5956
-
6057
# Temp fix

0 commit comments

Comments
 (0)