Compare commits
No commits in common. "08b36b5dcbed35c9a318ffcfba86eaa1c725e7b5" and "a9b3723e7645d051ad86796db8cf2f2020ab1eb3" have entirely different histories.
08b36b5dcb
...
a9b3723e76
29
action.yml
29
action.yml
@ -4,29 +4,20 @@ description: 'build docker image and push to simcu code'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: docker://node:20
|
||||
- uses: docker://node:18
|
||||
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'
|
||||
-c "npm install"
|
||||
-c " npm run build -- --outputPath=dist"
|
||||
|
||||
- uses: docker://docker:git
|
||||
with:
|
||||
entrypoint: "/bin/sh"
|
||||
entrypoint: "/bin/bash"
|
||||
args: |
|
||||
-c 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . && \
|
||||
echo ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}已经构建完了 && \
|
||||
docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} && \
|
||||
docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} && \
|
||||
echo ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}推送成功'
|
||||
-c 'echo "FROM nginx:alpine" > Dockerfile'
|
||||
-c 'echo "COPY dist /usr/share/nginx/html" >> Dockerfile'
|
||||
-c 'echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile'
|
||||
-c 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} .'
|
||||
-c 'docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}}'
|
||||
-c 'docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}'
|
Loading…
Reference in New Issue
Block a user