Skip to content

Commit eeef4a5

Browse files
authored
Create Sandbox.yml
1 parent edcd1e7 commit eeef4a5

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/Sandbox.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: QA-Prod
2+
3+
on:
4+
workflow_dispatch: # used for QA Deployments
5+
push: # used for Prod/Stg image building
6+
tags:
7+
- 'sandbox-*'
8+
- '[0-9]+.[0-9]+.[0-9]+'
9+
10+
jobs:
11+
build:
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set Docker Tag
19+
id: vars
20+
if: always()
21+
run: |
22+
REPOSITORY="sandbox-${GITHUB_REPOSITORY#*/}"
23+
echo ::set-output name=REPOSITORY::${REPOSITORY}
24+
if [[ ${{ github.ref }} == refs/tags* ]]; then
25+
TAG=${GITHUB_REF/refs\/tags\//}
26+
echo ::set-output name=TAG::${TAG}
27+
echo ::set-output name=TARGET::${{ secrets.SLACK_WEBHOOK_PROD }}
28+
else
29+
TAG=qa-${GITHUB_SHA::7}-$(date +%s)
30+
echo ::set-output name=TAG::${TAG}
31+
echo ::set-output name=TARGET::${{ secrets.SLACK_WEBHOOK }}
32+
fi
33+
- name: Build the Docker image
34+
env:
35+
LLC_ECR_HOST: ${{ secrets.LLC_ECR_HOST }}
36+
TAG: ${{ steps.vars.outputs.TAG }}
37+
REPOSITORY: ${{ steps.vars.outputs.REPOSITORY }}
38+
run: |
39+
docker build . --file Dockerfile --tag ${LLC_ECR_HOST}/$REPOSITORY:$TAG
40+
docker push ${LLC_ECR_HOST}/$REPOSITORY:$TAG

0 commit comments

Comments
 (0)