Signed-off-by: Kang Huaishuai <khs1994@khs1994.com>
This commit is contained in:
Kang Huaishuai 2020-07-03 12:10:24 +08:00
parent 8b186fb7e7
commit 911ce1a2e4
No known key found for this signature in database
GPG Key ID: 5E515022F565DA09
3 changed files with 6 additions and 2 deletions

0
.docker/docker-entrypoint.sh Normal file → Executable file
View File

View File

@ -75,7 +75,7 @@ jobs:
echo "FROM nginx:alpine" >> Dockerfile echo "FROM nginx:alpine" >> Dockerfile
echo "COPY .vuepress/dist /usr/share/nginx/html" >> Dockerfile echo "COPY .vuepress/dist /usr/share/nginx/html" >> Dockerfile
echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile
echo "CMD [\"sh\", \"/docker-entrypoint.sh\"]" >> Dockerfile echo "ENTRYPOINT [\"/docker-entrypoint.sh\"]" >> Dockerfile
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
@ -88,6 +88,10 @@ jobs:
. .
docker push dockerpracticesig/docker_practice:vuepress docker push dockerpracticesig/docker_practice:vuepress
docker run -it --rm -d -p 4000:80 dockerpracticesig/docker_practice:vuepress
curl 127.0.0.1:4000
env: env:
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}

View File

@ -21,7 +21,7 @@ after_success:
- echo "FROM nginx:alpine" >> Dockerfile - echo "FROM nginx:alpine" >> Dockerfile
- echo "COPY _book /usr/share/nginx/html" >> Dockerfile - echo "COPY _book /usr/share/nginx/html" >> Dockerfile
- echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile - echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile
- echo "CMD [\"sh\", \"/docker-entrypoint.sh\"]" >> Dockerfile - echo "ENTRYPOINT [\"/docker-entrypoint.sh\"]" >> Dockerfile
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export VCS_REF=`git rev-parse --short HEAD` - export VCS_REF=`git rev-parse --short HEAD`