Skip to content

Commit 6092c1a

Browse files
committed
doesnt like matrix in that way
1 parent b8d470b commit 6092c1a

2 files changed

Lines changed: 29 additions & 46 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,32 @@ jobs:
1414
strategy:
1515
matrix:
1616
env: [dev, prod, test]
17-
build:
18-
name: Build
19-
secrets: inherit
20-
uses: ./.github/workflows/build.yml
21-
with:
22-
env: ${{ matrix.env }}
17+
name: Build Docker
18+
runs-on: ubuntu-latest
19+
environment: ${{ matrix.env }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
with:
24+
ref: ${{ github.ref }}
25+
26+
- name: Configure AWS Credentials
27+
uses: aws-actions/configure-aws-credentials@v5
28+
with:
29+
aws-region: 'ap-southeast-2'
30+
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/github-nuj-repository-access
31+
role-session-name: NujPlatformAPISession
32+
33+
- name: Login to Amazon ECR
34+
id: login-ecr
35+
uses: aws-actions/amazon-ecr-login@v2
36+
37+
- name: Build, tag, and push the image to Amazon ECR
38+
id: build-image
39+
env:
40+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
41+
ECR_REPOSITORY: 'ssh_bastion'
42+
IMAGE_TAG: latest
43+
run: |
44+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.ref_name }} .
45+
docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags

0 commit comments

Comments
 (0)