Merge pull request #1183 from prezly/fix/full-width-card-story-date #1314
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build image and push Bea image to ECR | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build docker image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '1' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Generate build ID | |
id: prep | |
run: | | |
branch=${GITHUB_REF##*/} | |
sha=${GITHUB_SHA::8} | |
ts=$(date +%s) | |
echo "BUILD_ID=${branch}-${sha}-${ts}" >> "$GITHUB_OUTPUT" | |
- uses: docker/setup-buildx-action@v1 | |
id: buildx | |
with: | |
install: true | |
- name: Build, tag, and push image to Amazon ECR | |
id: build-image | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: ${{ steps.login-ecr.outputs.registry }}/theme-nextjs-bea:${{ steps.prep.outputs.BUILD_ID }} | |
secrets: | | |
"NEXT_PUBLIC_HCAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_HCAPTCHA_SITEKEY }}" | |
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" | |
"NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}" | |
- name: Clear cache | |
id: clear-cache | |
run: | | |
sleep 90 | |
curl --request POST \ | |
--url https://${{ secrets.PREZLY_CACHE_ENDPOINT }}/${{ secrets.PREZLY_THEME_ID }}/clear-cache \ | |
--header 'Authorization: Bearer ${{ secrets.PREZLY_API_TOKEN }}' \ | |
--header 'Content-Type: application/json' |