chore(ci): update

This commit is contained in:
xilesun 2024-11-07 12:23:31 +08:00
parent 0082fb7dec
commit a4c5e63634
2 changed files with 26 additions and 17 deletions

View File

@ -62,19 +62,19 @@ jobs:
username: ${{ secrets.ALI_DOCKER_USERNAME }}
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
- name: Login to Aliyun Container Registry (Public)
uses: docker/login-action@v2
with:
registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}
username: ${{ secrets.ALI_DOCKER_USERNAME }}
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to Aliyun Container Registry (Public)
# uses: docker/login-action@v2
# with:
# registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}
# username: ${{ secrets.ALI_DOCKER_USERNAME }}
# password: ${{ secrets.ALI_DOCKER_PASSWORD }}
#
# - name: Login to Docker Hub
# if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tags
id: set-tags

View File

@ -115,9 +115,9 @@ jobs:
shell: bash
run: |
if [[ "${{ github.ref_name }}" =~ "beta" ]]; then
echo "defaultTag=$(echo 'latest')" >> $GITHUB_OUTPUT
echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT
else
echo "defaultTag=$(echo 'next')" >> $GITHUB_OUTPUT
echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT
fi
- name: Checkout
uses: actions/checkout@v3
@ -147,10 +147,19 @@ jobs:
registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}
username: ${{ secrets.ALI_DOCKER_USERNAME }}
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
- name: Build and push
- name: Build and push main
if: ${{ steps.get-info.outputs.branch == 'main' }}
uses: docker/build-push-action@v3
with:
context: ./docker/nocobase
platforms: linux/amd64,linux/arm64
push: true
tags: nocobase/nocobase:${{ steps.get-info.outputs.defaultTag }},${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:${{ steps.get-info.outputs.defaultTag }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }}
tags: nocobase/nocobase:main,nocobase/nocobase:latest,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:main,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:latest,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }}
- name: Build and push next
if: ${{ steps.get-info.outputs.branch == 'next' }}
uses: docker/build-push-action@v3
with:
context: ./docker/nocobase
platforms: linux/amd64,linux/arm64
push: true
tags: nocobase/nocobase:next,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:next,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }}