mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
chore: add CI workflows for building and pushing arm64 Docker images
This commit is contained in:
parent
df57dde468
commit
c48a182206
61
.github/workflows/ci.yml
vendored
61
.github/workflows/ci.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
- "main"
|
- "main"
|
||||||
# - "test/ci"
|
- "test/ci"
|
||||||
# - "feature/flux"
|
# - "feature/flux"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -82,3 +82,62 @@ jobs:
|
|||||||
cd /home/laisky/repo/VPS
|
cd /home/laisky/repo/VPS
|
||||||
docker-compose -f b1-docker-compose.yml up -d --remove-orphans --force-recreate oneapi
|
docker-compose -f b1-docker-compose.yml up -d --remove-orphans --force-recreate oneapi
|
||||||
docker ps
|
docker ps
|
||||||
|
|
||||||
|
build_arm64_hash:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Add SHORT_SHA env property with commit short sha
|
||||||
|
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build and push arm64 hash label
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ppcelery/one-api:arm64-${{ env.SHORT_SHA }}
|
||||||
|
platforms: linux/arm64
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
build_arm64_latest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push arm64 latest
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ppcelery/one-api:arm64-latest
|
||||||
|
platforms: linux/arm64
|
||||||
|
cache-from: type=gha
|
||||||
|
# cache-to: type=gha,mode=max
|
||||||
|
Loading…
Reference in New Issue
Block a user