angular2docker/action.yml

23 lines
881 B
YAML
Raw Normal View History

2023-08-22 03:40:28 +00:00
# action.yml
name: 'build docker image and push to code'
description: 'build docker image and push to simcu code'
runs:
using: 'composite'
steps:
- uses: docker://node:18
with:
2023-08-22 03:47:44 +00:00
entrypoint: 'sh -c'
2023-08-22 03:44:57 +00:00
args: |
npm install
npm run build -- --outputPath=dist
2023-08-22 03:40:28 +00:00
2023-08-22 03:47:44 +00:00
- uses: docker://docker:cli
with:
entrypoint: 'sh -c'
2023-08-22 03:49:19 +00:00
args: |
2023-08-22 03:40:28 +00:00
echo "FROM nginx:alpine" > Dockerfile
echo "COPY dist /usr/share/nginx/html" >> Dockerfile
echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile
docker build -t ${{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 }}