Skip to content

Commit 966e2e0

Browse files
committed
Update build-and-push.yml
1 parent 9567636 commit 966e2e0

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

.github/workflows/build-and-push.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,51 @@ name: Build image and push Bea image to ECR
33
on:
44
push:
55
branches:
6-
- feature/dev-20159-move-top-level-folders-in-bea-to-src
6+
- main
77

88
jobs:
9-
#build:
10-
# name: Build docker image
11-
# runs-on: ubuntu-latest
9+
build:
10+
name: Build docker image
11+
runs-on: ubuntu-latest
1212

13-
# steps:
14-
# - name: Checkout
15-
# uses: actions/checkout@v4
16-
# with:
17-
# fetch-depth: '1'
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: '1'
1818

19-
# - name: Configure AWS credentials
20-
# uses: aws-actions/configure-aws-credentials@v4
21-
# with:
22-
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
23-
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
24-
# aws-region: eu-west-1
19+
- name: Configure AWS credentials
20+
uses: aws-actions/configure-aws-credentials@v4
21+
with:
22+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
23+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
24+
aws-region: eu-west-1
2525

26-
# - name: Login to Amazon ECR
27-
# id: login-ecr
28-
# uses: aws-actions/amazon-ecr-login@v2
26+
- name: Login to Amazon ECR
27+
id: login-ecr
28+
uses: aws-actions/amazon-ecr-login@v2
2929

30-
# - name: Generate build ID
31-
# id: prep
32-
# run: |
33-
# branch=${GITHUB_REF##*/}
34-
# sha=${GITHUB_SHA::8}
35-
# ts=$(date +%s)
36-
# echo "BUILD_ID=${branch}-${sha}-${ts}" >> "$GITHUB_OUTPUT"
37-
# - uses: docker/setup-buildx-action@v3
38-
# id: buildx
39-
# with:
40-
# install: true
41-
# - name: Build, tag, and push image to Amazon ECR
42-
# id: build-image
43-
# uses: docker/build-push-action@v6
44-
# with:
45-
# push: true
46-
# tags: ${{ steps.login-ecr.outputs.registry }}/theme-nextjs-bea:${{ steps.prep.outputs.BUILD_ID }}
47-
# secrets: |
48-
# "NEXT_PUBLIC_HCAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_HCAPTCHA_SITEKEY }}"
49-
# "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
50-
# "NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}"
30+
- name: Generate build ID
31+
id: prep
32+
run: |
33+
branch=${GITHUB_REF##*/}
34+
sha=${GITHUB_SHA::8}
35+
ts=$(date +%s)
36+
echo "BUILD_ID=${branch}-${sha}-${ts}" >> "$GITHUB_OUTPUT"
37+
- uses: docker/setup-buildx-action@v3
38+
id: buildx
39+
with:
40+
install: true
41+
- name: Build, tag, and push image to Amazon ECR
42+
id: build-image
43+
uses: docker/build-push-action@v6
44+
with:
45+
push: true
46+
tags: ${{ steps.login-ecr.outputs.registry }}/theme-nextjs-bea:${{ steps.prep.outputs.BUILD_ID }}
47+
secrets: |
48+
"NEXT_PUBLIC_HCAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_HCAPTCHA_SITEKEY }}"
49+
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
50+
"NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}"
5151
build-preview:
5252
name: Build preview docker image
5353
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)