Skip to content

Commit

Permalink
ci: build arm image
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed May 5, 2024
1 parent d557f56 commit 66eb6bc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/build-publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ jobs:
run: |
cd web
npm run build
- name: Build image
run: |
docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest .
- name: Publish image
run: |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest
# - name: Build image
# run: |
# docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest .
# - name: Publish image
# run: |
# docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
# docker push ${{ secrets.DOCKER_HUB_USERNAME }}/free-one-api:latest
- name: Login to Registry
run: docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Create Buildx
run: docker buildx create --name mybuilder --use
- name: Build # image name
run: docker buildx build --platform linux/arm64,linux/amd64 -t rockchin/free-one-api:latest . --push
17 changes: 12 additions & 5 deletions .github/workflows/build-publish-release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ jobs:
id: get_version
if: (startsWith(env.GITHUB_REF, 'refs/tags/')||startsWith(github.ref, 'refs/tags/')) && startsWith(github.repository, 'RockChinQ/free-one-api')
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build image # image name: rockchin/free-one-api:<VERSION>
run: docker build --network=host -t rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }} .
# - name: Build image # image name: rockchin/free-one-api:<VERSION>
# run: docker build --network=host -t rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }} .
# - name: Login to Registry
# run: docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}

# - name: Push release image
# if: (startsWith(env.GITHUB_REF, 'refs/tags/')||startsWith(github.ref, 'refs/tags/')) && startsWith(github.repository, 'RockChinQ/free-one-api')
# run: docker push rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }}
- name: Login to Registry
run: docker login --username=${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Push release image
- name: Create Buildx
run: docker buildx create --name mybuilder --use
- name: Build # image name
if: (startsWith(env.GITHUB_REF, 'refs/tags/')||startsWith(github.ref, 'refs/tags/')) && startsWith(github.repository, 'RockChinQ/free-one-api')
run: docker push rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }}
run: docker buildx build --platform linux/arm64,linux/amd64 -t rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }} . --push

0 comments on commit 66eb6bc

Please sign in to comment.