Push commit hash image tag to ECR
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled

This commit is contained in:
Eric Allam
2023-06-27 16:37:39 +01:00
parent 6750429cd4
commit 7204aa0c9a
+18
View File
@@ -51,6 +51,9 @@ jobs:
publish:
needs: [typecheck]
runs-on: buildjet-4vcpu-ubuntu-2204
outputs:
version: ${{ steps.get_version.outputs.version }}
short_sha: ${{ steps.get_commit.outputs.sha_short }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
@@ -70,6 +73,11 @@ jobs:
fi
echo ::set-output name=version::${IMAGE_TAG}
- name: 🔢 Get the commit hash
id: get_commit
run: |
echo ::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-7)
- name: 🐳 Build Docker Image
run: |
docker build -t release_build_image -f ./docker/Dockerfile .
@@ -126,3 +134,13 @@ jobs:
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: trigger.dev
- name: 🌐 Push commit hash to Amazon ECR
if: startsWith(github.ref, 'refs/heads/')
run: |
docker tag release_build_image $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: trigger.dev
IMAGE_TAG: ${{ steps.get_version.outputs.version }}-${{ steps.get_commit.outputs.sha_short }}