Skip to content

Commit

Permalink
update ci to build and push with tag (#4)
Browse files Browse the repository at this point in the history
* update ci to build and push with tag

* add: shell
  • Loading branch information
andrleite authored Sep 14, 2024
1 parent 70f449e commit eb0814c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ runs:
shell: bash
if: github.event_name == 'pull_request'

- name: Set TAG variable if a tag is pushed
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
shell: bash
if: startsWith(github.ref, 'refs/tags/')

- name: cd/push-image-with-tag
run: "make push-image TAG=${TAG}"
shell: bash
if: startsWith(github.ref, 'refs/tags/')

- name: cd/push-image
run: "make push-image"
shell: bash
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/')
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- main
tags:
- '*'

permissions:
contents: read
Expand Down

0 comments on commit eb0814c

Please sign in to comment.