From 6117241ba29838008c552242c717f68d5ce01a91 Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 16 Sep 2023 22:22:13 +0800 Subject: [PATCH] test --- .github/workflows/build_docker_image.yml | 75 +----------------------- docker/Dockerfile | 2 + 2 files changed, 4 insertions(+), 73 deletions(-) diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index 1e1ebb0cfc3..c18e7d2823d 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -13,79 +13,8 @@ on: workflow_dispatch: jobs: - to_gitlab: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git@gitlab.com:whyour/qinglong.git - ssh_private_key: - ${{ secrets.GITLAB_SSH_PK }} - - to_gitee: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git@gitee.com:whyour/qinglong.git - ssh_private_key: - ${{ secrets.GITLAB_SSH_PK }} - - build-static: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: '8.3.1' - - - uses: actions/setup-node@v3 - with: - cache: 'pnpm' - - - name: build front and back - run: | - pnpm install --frozen-lockfile - pnpm build:front - pnpm build:back - - - name: copy to static repo - env: - GITHUB_REPO: github.com/${{ github.repository_owner }}/qinglong-static - GITHUB_BRANCH: ${{ github.ref_name }} - REPO_GITEE: git@gitee.com:whyour/qinglong-static.git - REPO_GITLAB: git@gitlab.com:whyour/qinglong-static.git - PRIVATE_KEY: ${{ secrets.GITLAB_SSH_PK }} - run: | - mkdir -p tmp - cd ./tmp - cp -rf ../static/* ./ - git init -b ${GITHUB_BRANCH} && git add . - git config --local user.name 'github-actions[bot]' - git config --local user.email 'github-actions[bot]@users.noreply.github.com' - git commit --allow-empty -m "copy static at $(date +'%Y-%m-%d %H:%M:%S')" - git push --force --quiet "https://${{ secrets.API_TOKEN }}@${GITHUB_REPO}.git" ${GITHUB_BRANCH}:${GITHUB_BRANCH} - - mkdir -p ~/.ssh - echo "${PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - - export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -l git" - git remote add gitee "${REPO_GITEE}" - git remote add gitlab "${REPO_GITLAB}" - git push --force --quiet gitee ${GITHUB_BRANCH}:${GITHUB_BRANCH} - git push --force --quiet gitlab ${GITHUB_BRANCH}:${GITHUB_BRANCH} - build: - needs: build-static + # needs: build-static runs-on: ubuntu-latest @@ -156,7 +85,7 @@ jobs: QL_BRANCH=${{ github.ref_name }} SOURCE_COMMIT=${{ github.sha }} network: host - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x,linux/386 + platforms: linux/s390x context: . file: ./docker/Dockerfile push: true diff --git a/docker/Dockerfile b/docker/Dockerfile index 66dfa603962..8f8fb783768 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,6 +3,8 @@ COPY package.json .npmrc pnpm-lock.yaml /tmp/build/ RUN set -x \ && apk update \ && apk add nodejs npm git \ + && echo -e "安装 pnpm" \ && npm i -g pnpm@8.3.1 \ + && echo -e "安装依赖" \ && cd /tmp/build \ && pnpm install --prod