diff --git a/.github/workflows/build-publish-latest.yaml b/.github/workflows/build-publish-latest.yaml index e6ef9a4..f3783fb 100644 --- a/.github/workflows/build-publish-latest.yaml +++ b/.github/workflows/build-publish-latest.yaml @@ -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 \ No newline at end of file + # - 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 diff --git a/.github/workflows/build-publish-release-tag.yaml b/.github/workflows/build-publish-release-tag.yaml index 0cf464a..7bda8d7 100644 --- a/.github/workflows/build-publish-release-tag.yaml +++ b/.github/workflows/build-publish-release-tag.yaml @@ -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: - run: docker build --network=host -t rockchin/free-one-api:${{ steps.get_version.outputs.VERSION }} . + # - name: Build image # image name: rockchin/free-one-api: + # 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