This commit is contained in:
xRain 2023-08-22 12:04:52 +08:00
parent db9049c457
commit a9b3723e76

View File

@ -6,18 +6,18 @@ runs:
steps: steps:
- uses: docker://node:18 - uses: docker://node:18
with: with:
entrypoint: "/bin/bash -c" entrypoint: "/bin/bash"
args: | args: |
npm install -c "npm install"
npm run build -- --outputPath=dist -c " npm run build -- --outputPath=dist"
- uses: docker://docker:git - uses: docker://docker:git
with: with:
entrypoint: "/bin/bash -c" entrypoint: "/bin/bash"
args: | args: |
echo "FROM nginx:alpine" > Dockerfile -c 'echo "FROM nginx:alpine" > Dockerfile'
echo "COPY dist /usr/share/nginx/html" >> Dockerfile -c 'echo "COPY dist /usr/share/nginx/html" >> Dockerfile'
echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile -c 'echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile'
docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} . -c 'docker build -t ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} .'
docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}} -c 'docker login ${{env.DOCKER_REGISTRY}} -u ${{env.DOCKER_USER}} -p ${{env.DOCKER_PASS}}'
docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }} -c 'docker push ${{env.DOCKER_REGISTRY}}/${{github.repository}}:${{ github.ref_name }}'