diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml new file mode 100644 index 000000000..68b95bc9e --- /dev/null +++ b/.github/workflows/release-ci.yml @@ -0,0 +1,65 @@ +name: release-ci + +on: + push: + tags: + - 'v*' + +jobs: + publish-npm: + runs-on: ubuntu-latest + container: node:16 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: yarn install and build + run: | + yarn config set registry https://registry.npmjs.org/ + yarn install + yarn build + - + name: publish npmjs.org + run: | + npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} + yarn release:force --registry https://registry.npmjs.org/ + push-docker: + runs-on: ubuntu-latest + needs: publish-npm + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + nocobase/nocobase + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: ./docker/nocobase + platforms: linux/amd64,linux/arm64 + push: true + tags: nocobase/nocobase:latest,${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/docker/nocobase/Dockerfile b/docker/nocobase/Dockerfile index 89014a8a0..ae4cb0266 100644 --- a/docker/nocobase/Dockerfile +++ b/docker/nocobase/Dockerfile @@ -3,6 +3,7 @@ FROM node:16-stretch-slim as builder WORKDIR /app RUN cd /app \ + && yarn config set network-timeout 600000 -g \ && yarn create nocobase-app my-nocobase-app -a -e APP_ENV=production \ && cd /app/my-nocobase-app \ && yarn install --production