From 80df38cf4b4d46f1a88091ad29ffd68ee3f27d00 Mon Sep 17 00:00:00 2001 From: xRain Date: Wed, 11 Dec 2024 02:18:54 +0800 Subject: [PATCH] fix aiStory Style --- README.md | 0 action.yml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 README.md create mode 100644 action.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..ff39df0 --- /dev/null +++ b/action.yml @@ -0,0 +1,38 @@ +# action.yml +name: 'build docker image and push to code' +description: 'build docker image and push to simcu code' +runs: + using: 'composite' + steps: + - name: build app + uses: docker://gradle:jdk21 + with: + entrypoint: "/bin/bash" + args: | + -c "export https_proxy=http://100.100.13.14:8118 && \ + export http_proxy=http://100.100.13.14:8118 && \ + ./gradlew build && \ + cd build/libs && \ + mv $(ls *.jar) app.jar" + + - name: create dockerfile + uses: docker://ubuntu:latest + with: + entrypoint: "/bin/bash" + args: | + -c 'echo "FROM openjdk:21" > Dockerfile && \ + echo "COPY build/libs/app.jar /app.jar" >> Dockerfile && \ + echo "ENTRYPOINT [\"java\", \"-jar\", \"/app.jar\"]" >> Dockerfile && \ + echo "已经构建完DOCKERFILE了" && \ + cat Dockerfile' + + - name: build docker image + 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