Skip to content
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

feat: support arm64 #231

Merged
merged 9 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions .github/workflows/upload_app_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ on:
- 'requirements.txt'
- '!./web/**'
jobs:
build_app_image:
build_amd64:
runs-on: ubuntu-latest

env:
DOCKERHUB_USERNAME: rikasai
DOCKER_REPOSITORY_NAME: fast-runner-backend
ARCH: amd64

steps:
- name: Check out the repository
Expand All @@ -38,7 +39,7 @@ jobs:
GIT_TAG=$(git describe --tags --exact-match ${{ github.sha }} 2> /dev/null || echo "")
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV

- name: Build APP Image
- name: Build AMD64 Image
uses: docker/build-push-action@v2
with:
context: .
Expand All @@ -47,4 +48,46 @@ jobs:
push: true
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest-amd64
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}-amd64', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}

build_arm64:
runs-on: ubuntu-24.04-arm

env:
DOCKERHUB_USERNAME: rikasai
DOCKER_REPOSITORY_NAME: fast-runner-backend
ARCH: arm64

steps:
- name: Check out the repository
uses: actions/checkout@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get Git tag if exists
id: get_tag
run: |
GIT_TAG=$(git describe --tags --exact-match ${{ github.sha }} 2> /dev/null || echo "")
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV

- name: Build ARM64 Image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/arm64
push: true
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest-arm64
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}-arm64', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
63 changes: 54 additions & 9 deletions .github/workflows/upload_web_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ on:
- '**/*.py'

jobs:
build_and_push:
build_amd64:
runs-on: ubuntu-latest

env:
DOCKERHUB_USERNAME: rikasai
DOCKER_REPOSITORY_NAME: fast-runner-frontend
ARCH: amd64

steps:
- name: Check out the repository
uses: actions/checkout@v4

# Cache yarn dependencies
- name: Cache yarn dependencies
uses: actions/cache@v2
with:
Expand All @@ -32,11 +31,8 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

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

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -50,7 +46,7 @@ jobs:
GIT_TAG=$(git describe --tags --exact-match ${{ github.sha }} 2> /dev/null || echo "")
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV

- name: Build and push Docker image
- name: Build and push AMD64 Docker image
uses: docker/build-push-action@v2
with:
context: ./web
Expand All @@ -59,4 +55,53 @@ jobs:
push: true
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest-amd64
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}-amd64', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}

build_arm64:
runs-on: ubuntu-22.04-arm
env:
DOCKERHUB_USERNAME: rikasai
DOCKER_REPOSITORY_NAME: fast-runner-frontend
ARCH: arm64

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Cache yarn dependencies
uses: actions/cache@v2
with:
path: ./web/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

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

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get Git tag if exists
id: get_tag
run: |
GIT_TAG=$(git describe --tags --exact-match ${{ github.sha }} 2> /dev/null || echo "")
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV

- name: Build and push ARM64 Docker image
uses: docker/build-push-action@v2
with:
context: ./web
file: ./web/Dockerfile-build
platforms: linux/arm64
push: true
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_REPOSITORY_NAME }}:latest-arm64
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
${{ env.GIT_TAG != '' && format('{0}/{1}:{2}-arm64', env.DOCKERHUB_USERNAME, env.DOCKER_REPOSITORY_NAME, env.GIT_TAG) || '' }}
Loading