Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
df45f8ba9c | |||
4ad3a5a519 | |||
fdb8159ab6 | |||
9aee94ee20 | |||
321aa393d2 | |||
5dd538fbb6 | |||
c8b93db337 | |||
53edfe317e | |||
6ed7b99fd9 | |||
b70db03b17 | |||
338f3bf468 | |||
22d678ab22 | |||
c05dd83c88 | |||
82f5744234 | |||
e2c52c0c1e | |||
610f80d88d |
67
action.yml
67
action.yml
@ -1,38 +1,39 @@
|
||||
# action.yml
|
||||
name: 'build docker image and push to code'
|
||||
description: 'build docker image and push to simcu code'
|
||||
name: "build docker image and push to code"
|
||||
description: "build docker image and push to simcu code"
|
||||
runs:
|
||||
using: 'composite'
|
||||
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 && \
|
||||
gradle build && \
|
||||
cd build/libs && \
|
||||
mv $(ls *.jar) app.jar"
|
||||
- name: build app
|
||||
uses: docker://gradle:jdk21
|
||||
with:
|
||||
entrypoint: "/bin/bash"
|
||||
args: |
|
||||
-c "echo 'bootJar {archiveFileName = \"app.jar\"}' >> build.gradle && \
|
||||
gradle build -x test -Dhttps.proxyHost=100.100.13.14 -Dhttps.proxyPort=8118 \
|
||||
-Dhttp.proxyHost=100.100.13.14 -Dhttp.proxyPort=8118 --no-daemon"
|
||||
|
||||
- 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: 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 }}推送成功'
|
||||
- name: build docker image
|
||||
uses: docker://docker:git
|
||||
env:
|
||||
HTTPS_PROXY: http://100.100.13.14:8118
|
||||
HTTP_PROXY: http://100.100.13.14:8118
|
||||
with:
|
||||
entrypoint: "/bin/sh"
|
||||
args: |
|
||||
-c 'docker image ls && 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 }}推送成功'
|
||||
|
Reference in New Issue
Block a user