-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (54 loc) · 1.65 KB
/
image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build Image
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
bench:
runs-on: codebuild-problem-github-actions-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v4
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: "frontend/pnpm-lock.yaml"
- name: Build frontend
working-directory: ./bench
run: |
task gen-frontend
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=mirror.gcr.io/moby/buildkit:buildx-stable-1
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["mirror.gcr.io"]
- name: Configure AWS credentials from IAM Role
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_BUILD_ROLE_ARN }}
aws-region: ap-northeast-1
- name: ECR
uses: docker/login-action@v3
with:
registry: ${{ vars.AWS_ECR_REGISTRY }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./bench
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ vars.AWS_ECR_REPOSITORY }}:latest
${{ vars.AWS_ECR_REPOSITORY }}:${{ github.sha }}