Skip to content

Commit 4524bd4

Browse files
authored
[xc-admin-frontend] fix github action (#657)
* Missing dollar sign * Test push: * Fix truncate * Long hash * Add checkout step * Shortened hash * Add spaces * Get date from command * Remove push on pull request
1 parent 40bc1e6 commit 4524bd4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/xc-admin-frontend-image-push.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ jobs:
1010
xc-admin-image:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set image tag to timestamp and shortened commit hash
15+
run: |
16+
SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
17+
TIMESTAMP=$(date +%s)
18+
echo "IMAGE_TAG=${TIMESTAMP}-${SHORT_HASH}" >> "${GITHUB_ENV}"
1319
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
1420
with:
1521
role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
@@ -23,4 +29,3 @@ jobs:
2329
env:
2430
ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
2531
ECR_REPOSITORY: xc-admin-frontend
26-
IMAGE_TAG: ${{ github.event.head_commit.timestamp }}-{{github.sha | truncate(7, '')}}

0 commit comments

Comments
 (0)