From 96b7bd3cb5b38b02d24e58f7458328f72c94ccbe Mon Sep 17 00:00:00 2001 From: xRain Date: Sun, 23 Jun 2024 22:02:40 +0800 Subject: [PATCH] fix ci --- action.yml | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/action.yml b/action.yml index d6facb0..d16584b 100644 --- a/action.yml +++ b/action.yml @@ -4,29 +4,29 @@ description: 'build docker image and push to simcu code' runs: using: 'composite' steps: - - uses: docker://node:20 - with: - entrypoint: "/bin/bash" - args: | - -c "npm install && \ - npm run build -- --output-path=dist" - - - uses: docker://ubuntu:latest - with: - entrypoint: "/bin/bash" - args: | - -c 'echo "FROM nginx:alpine" > Dockerfile && \ - echo "COPY dist /usr/share/nginx/html" >> Dockerfile && \ - echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile && \ - echo "已经构建完DOCKERFILE了" && \ - cat Dockerfile' + - uses: docker://node:20 + with: + entrypoint: "/bin/bash" + args: | + -c "npm install && \ + npm run build -- --output-path=dist" - - uses: docker://docker:git - with: - entrypoint: "/bin/sh" - args: | - -c 'docker build -t ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . && \ - echo ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}已经构建完了 && \ - docker login ${{vars.DOCKER_REGISTRY}} -u ${{vars.DOCKER_USER}} -p ${{vars.DOCKER_PASS}} && \ - docker push ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \ - echo ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}推送成功' \ No newline at end of file + - uses: docker://ubuntu:latest + with: + entrypoint: "/bin/bash" + args: | + -c 'echo "FROM nginx:alpine" > Dockerfile && \ + echo "COPY dist/browser /usr/share/nginx/html" >> Dockerfile && \ + echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile && \ + echo "已经构建完DOCKERFILE了" && \ + cat Dockerfile' + + - uses: docker://docker:git + with: + entrypoint: "/bin/sh" + args: | + -c 'docker build -t ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . && \ + echo ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}已经构建完了 && \ + docker login ${{vars.DOCKER_REGISTRY}} -u ${{vars.DOCKER_USER}} -p ${{vars.DOCKER_PASS}} && \ + docker push ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \ + echo ${{vars.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}推送成功'