Skip to content

Commit

Permalink
fix: fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jun 19, 2024
1 parent 3b27e0e commit d4c6826
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 20 deletions.
55 changes: 45 additions & 10 deletions .github/workflows/update_r4rank.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,83 @@
name: Update Rank

on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'
target-platform:
description: 'Target Platform'
required: true
default: 'amd64'

jobs:
update_rank:
build_and_push_amd64:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image for amd64
if: ${{ github.event.inputs['target-platform'] == 'amd64' }}
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/r4rank:${{ github.event.inputs.tags }}
tags: beclab/r4rank:${{ github.ref_name }}-amd64
file: Dockerfile.r4rank.amd64
platforms: linux/amd64

build_and_push_arm64:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image for arm64
if: ${{ github.event.inputs['target-platform'] == 'arm64' }}
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/r4rank:${{ github.event.inputs.tags }}
tags: beclab/r4rank:${{ github.ref_name }}-arm64
file: Dockerfile.r4rank.arm64
platforms: linux/arm64

create_and_push_manifest:
runs-on: ubuntu-latest
needs: [build_and_push_amd64, build_and_push_arm64]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Create and push manifest
run: |
docker manifest create beclab/r4rank:${{ github.ref_name }} \
beclab/r4rank:${{ github.ref_name }}-amd64 \
beclab/r4rank:${{ github.ref_name }}-arm64
docker manifest push beclab/r4rank:${{ github.ref_name }}
55 changes: 45 additions & 10 deletions .github/workflows/update_r4train.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,83 @@
name: Update Train

on:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'
target-platform:
description: 'Target Platform'
required: true
default: 'amd64'

jobs:
update_train:
build_and_push_amd64:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image for amd64
if: ${{ github.event.inputs['target-platform'] == 'amd64' }}
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/r4train:${{ github.event.inputs.tags }}
tags: beclab/r4train:${{ github.ref_name }}-amd64
file: Dockerfile.r4train.amd64
platforms: linux/amd64

build_and_push_arm64:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

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

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image for arm64
if: ${{ github.event.inputs['target-platform'] == 'arm64' }}
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/r4train:${{ github.event.inputs.tags }}
tags: beclab/r4train:${{ github.ref_name }}-arm64
file: Dockerfile.r4train.arm64
platforms: linux/arm64

create_and_push_manifest:
runs-on: ubuntu-latest
needs: [build_and_push_amd64, build_and_push_arm64]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Create and push manifest
run: |
docker manifest create beclab/r4train:${{ github.ref_name }} \
beclab/r4train:${{ github.ref_name }}-amd64 \
beclab/r4train:${{ github.ref_name }}-arm64
docker manifest push beclab/r4train:${{ github.ref_name }}

0 comments on commit d4c6826

Please sign in to comment.