Skip to content

Commit

Permalink
version including github sha and time
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharth9903 committed Mar 11, 2024
1 parent 249b419 commit d2e16d4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time

- name: Run string replace
uses: frabert/replace-string-action@v2
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: "-"
flags: "g"

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -43,5 +56,6 @@ jobs:

- name: Deploy to Elastic Beanstalk
run: |
aws elasticbeanstalk create-application-version --application-name Gateway --version-label $GITHUB_SHA --source-bundle S3Bucket=docker-login-bucket-seistart,S3Key=Dockerrun.aws.json
aws elasticbeanstalk update-environment --application-name Gateway --environment-name seistart-docker-dev --version-label $GITHUB_SHA
version_label="$GITHUB_SHA-${{ steps.format-time.outputs.outputs.replaced }}"
aws elasticbeanstalk create-application-version --application-name Gateway --version-label "$version_label" --source-bundle S3Bucket=docker-login-bucket-seistart,S3Key=Dockerrun.aws.json
aws elasticbeanstalk update-environment --application-name Gateway --environment-name seistart-docker-dev --version-label "$version_label"

0 comments on commit d2e16d4

Please sign in to comment.