-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use arm runner #2483
base: main
Are you sure you want to change the base?
use arm runner #2483
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,38 +9,22 @@ jobs: | |
strategy: | ||
matrix: | ||
runs-on: | ||
- "ubuntu-latest" | ||
- "ubuntu-24.04" | ||
- "ubuntu-24.04-arm" | ||
runs-on: ${{ matrix.runs-on }} | ||
timeout-minutes: 10 | ||
if: github.event.pusher.name != 'dreamkast-cloudnativedays' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
- 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: us-west-2 | ||
|
||
- name: Login to Amazon ECR | ||
- uses: aws-actions/amazon-ecr-login@v2 | ||
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-ecs | ||
tags: | | ||
type=sha,prefix=,format=long | ||
type=ref,event=branch | ||
|
||
- name: Prepare-tag | ||
id: tags | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 |
||
|
@@ -51,13 +35,13 @@ jobs: | |
"ARM64" ) arch="arm64" ;; | ||
esac | ||
echo "tag=${{ github.sha }}-${arch}" >> $GITHUB_OUTPUT | ||
|
||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./ | ||
file: ./Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: true | ||
tags: ${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs:${{ steps.tags.outputs.tag }} | ||
provenance: false | ||
|
@@ -66,10 +50,33 @@ jobs: | |
cache-to: type=gha,mode=max | ||
|
||
merge-images: | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
matrix: | ||
runs-on: | ||
- "ubuntu-24.04" | ||
- "ubuntu-24.04-arm" | ||
runs-on: ${{ matrix.runs-on }} | ||
timeout-minutes: 10 | ||
needs: ["build"] | ||
steps: | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs | ||
tags: | | ||
type=sha,prefix=,format=long | ||
type=ref,event=branch | ||
- name: Prepare-tag | ||
id: tags | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 |
||
arch="" | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context | ||
case "${{ runner.arch }}" in | ||
"X64" ) arch="amd64" ;; | ||
"ARM64" ) arch="arm64" ;; | ||
esac | ||
echo "tag=${arch}" >> $GITHUB_OUTPUT | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
|
@@ -87,9 +94,22 @@ jobs: | |
- name: Create a New Image | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 |
||
image_tag_sha="${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs:${{ github.sha }}" | ||
docker buildx imagetools create \ | ||
--tag ${image_tag_sha} \ | ||
${image_tag_sha}-amd64 | ||
|
||
# Create array of image tags from meta output | ||
image_tags=() | ||
for tag in ${{ steps.meta.outputs.tags }}; do | ||
image_tags+=("${tag}-${{ steps.tags.outputs.tag }}") | ||
done | ||
|
||
# Join all tags with comma for buildx imagetools create command | ||
joined_tags=$(IFS=,; echo "${image_tags[*]}") | ||
|
||
# Create manifest lists for each tag from meta output | ||
for tag in ${{ steps.meta.outputs.tags }}; do | ||
docker buildx imagetools create \ | ||
--tag ${tag} \ | ||
${image_tag_sha}-${{ steps.tags.outputs.tag }} | ||
|
||
|
||
# - name: Run Trivy vulnerability scanner | ||
# uses: aquasecurity/trivy-action@master | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,34 +6,34 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
runs-on: | ||
- "ubuntu-24.04" | ||
- "ubuntu-24.04-arm" | ||
runs-on: ${{ matrix.runs-on }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
- uses: docker/setup-buildx-action@v3 | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
- 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 | ||
- uses: aws-actions/amazon-ecr-login@v2 | ||
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-ecs | ||
tags: | | ||
type=sha,prefix=,format=long | ||
type=ref,event=tag | ||
|
||
- name: Prepare-tag | ||
id: tags | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 |
||
arch="" | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context | ||
case "${{ runner.arch }}" in | ||
"X64" ) arch="amd64" ;; | ||
"ARM64" ) arch="arm64" ;; | ||
esac | ||
echo "tag=${{ github.sha }}-${arch}" >> $GITHUB_OUTPUT | ||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
|
@@ -42,7 +42,69 @@ jobs: | |
file: ./Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
tags: ${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs:${{ steps.tags.outputs.tag }} | ||
provenance: false | ||
labels: ${{ steps.meta.outputs.labels }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 |
||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
merge-images: | ||
strategy: | ||
matrix: | ||
runs-on: | ||
- "ubuntu-24.04" | ||
- "ubuntu-24.04-arm" | ||
runs-on: ${{ matrix.runs-on }} | ||
timeout-minutes: 10 | ||
needs: ["build"] | ||
steps: | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 |
||
tags: | | ||
type=sha,prefix=,format=long | ||
type=ref,event=tag | ||
- name: Prepare-tag | ||
id: tags | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [actionlint] reported by reviewdog 🐶 |
||
arch="" | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context | ||
case "${{ runner.arch }}" in | ||
"X64" ) arch="amd64" ;; | ||
"ARM64" ) arch="arm64" ;; | ||
esac | ||
echo "tag=${arch}" >> $GITHUB_OUTPUT | ||
- name: Set up Docker 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: us-west-2 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Create a New Image | ||
run: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [actionlint] reported by reviewdog 🐶 |
||
image_tag_sha="${{ steps.login-ecr.outputs.registry }}/dreamkast-ecs:${{ github.sha }}" | ||
|
||
# Create array of image tags from meta output | ||
image_tags=() | ||
for tag in ${{ steps.meta.outputs.tags }}; do | ||
image_tags+=("${tag}-${{ steps.tags.outputs.tag }}") | ||
done | ||
|
||
# Join all tags with comma for buildx imagetools create command | ||
joined_tags=$(IFS=,; echo "${image_tags[*]}") | ||
|
||
# Create manifest lists for each tag from meta output | ||
for tag in ${{ steps.meta.outputs.tags }}; do | ||
docker buildx imagetools create \ | ||
--tag ${tag} \ | ||
${image_tag_sha}-${{ steps.tags.outputs.tag }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [actionlint] reported by reviewdog 🐶
string should not be empty [syntax-check]
dreamkast/.github/workflows/build-branch.yml
Line 5 in 9e05381