Files
angular2docker/action.yml

35 lines
1.5 KiB
YAML
Raw Normal View History

2023-08-22 11:40:28 +08:00
# action.yml
2025-11-07 21:34:57 +08:00
name: "build docker image and push to code"
description: "build docker image and push to simcu code"
2023-08-22 11:40:28 +08:00
runs:
2025-11-07 21:34:57 +08:00
using: "composite"
2023-08-22 11:40:28 +08:00
steps:
2025-11-07 21:37:29 +08:00
- uses: docker://node:25
2025-11-07 21:34:57 +08:00
with:
entrypoint: "/bin/bash"
args: |
-c "export https_proxy=http://100.100.13.14:8118 && \
export http_proxy=http://100.100.13.14:8118 && \
npm install && \
2025-11-07 21:38:26 +08:00
npm run build -- --output-path=dist --define AppVersion=\"'${{github.ref_name}}'\""
2023-08-22 11:40:28 +08:00
2025-11-07 21:34:57 +08:00
- 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 }}推送成功'