# 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: entrypoint: "/bin/bash" args: | -c "npm install" -c " npm run build -- --outputPath=dist" - uses: docker://docker:git with: entrypoint: "/bin/bash" args: | -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 }}'