Skip to content

Commit

Permalink
Cicd/split job build arm (#153)
Browse files Browse the repository at this point in the history
* perf: split build arm64 to another job

* fix: make cicd run ubuntu-latest
  • Loading branch information
meomeocoj authored Feb 16, 2024
1 parent 8d8e83e commit f7c05e8
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions .github/workflows/publish_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
docker:
docker-amd:
strategy:
matrix:
node: ["18.18.0"]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,11 +61,58 @@ jobs:
context: .
cache-from: type=registry,ref=oraichain/defi_oraidex-backend:buildcache
cache-to: type=registry,ref=oraichain/defi_oraidex-backend:buildcache,mode=max
platforms: linux/amd64,linux/arm64
platforms: linux/amd64

swarm:
docker-arm:
strategy:
matrix:
node: ["18.18.0"]
runs-on: ubuntu-20.04
needs: docker
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
oraichain/defi_oraidex-backend
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,enable=true,priority=100,prefix=,suffix=-arm64,format=short
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
build-args: |
GIT_COMMIT=${{ env.GIT_COMMIT }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
cache-from: type=registry,ref=oraichain/defi_oraidex-backend:buildcache-arm64
cache-to: type=registry,ref=oraichain/defi_oraidex-backend:buildcache-arm64,mode=max
platforms: linux/arm64
swarm:
runs-on: ubuntu-latest
needs: docker-amd
steps:
- name: Extract SHA
id: extract_sha
Expand Down

0 comments on commit f7c05e8

Please sign in to comment.