Skip to content

Commit

Permalink
separate build Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaKitazawa committed Apr 14, 2024
1 parent f3785eb commit 048d54f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: build dreamkast-weaver image
name: build dreamkast-weaver image when pushed branches

on: push
on:
push:
branches: ["*"]

jobs:
build:
Expand All @@ -18,7 +20,7 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
aws-region: us-west-2

- name: Login to Amazon ECR
id: login-ecr
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/build-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build dreamkast-weaver image when pushed tags

on:
push:
tags: ["*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.login-ecr.outputs.registry }}/dreamkast-weaver
tags: |
type=ref,event=tag
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 048d54f

Please sign in to comment.