Skip to content

Commit

Permalink
Update deploy wrokflow to allow the deploy of tags and not only branches
Browse files Browse the repository at this point in the history
  • Loading branch information
botisSmile committed Oct 12, 2023
1 parent acb3468 commit 4d1fa8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
version: ${{ github.ref_name }}
last_published_version: ${{ github.ref_name }}
back_version_is_tag: true
front_version_is_tag: true
secrets:
AWS_DEPLOY_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/deploy-int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
required: false
default: "dev-master"
type: string
back_version_is_tag:
description: "Back version to deploy is a tag ?"
required: false
default: false
type: boolean
front_version_is_tag:
description: "Front version to deploy is a tag ?"
required: false
Expand Down Expand Up @@ -39,8 +44,8 @@ jobs:
steps:
- name: Deploy in EC2
env:
back_branch: ${{ format('origin/{0}', inputs.version) }}
front_branch: ${{ inputs.version == 'master' && 'origin/main' || inputs.front_version_is_tag == true && format('origin/v{0}', inputs.version) || format('origin/{0}', inputs.version) }}
back_branch: ${{ inputs.back_version_is_tag == true && format('tags/{0}', inputs.version) || format('origin/{0}', inputs.version) }}
front_branch: ${{ inputs.version == 'master' && 'origin/main' || inputs.front_version_is_tag == true && format('tags/v{0}', inputs.version) || format('origin/{0}', inputs.version) }}
composer_version: ${{ inputs.version == 'master' && 'dev-master' || (contains(inputs.version, 'x') && format('{0}-dev', inputs.version) || inputs.version) }}
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
HOSTNAME : ${{ secrets.AWS_HOSTNAME }}
Expand Down

0 comments on commit 4d1fa8a

Please sign in to comment.