build vuepress docker image

Signed-off-by: Kang Huaishuai <khs1994@khs1994.com>
This commit is contained in:
Kang Huaishuai
2020-04-28 22:39:47 +08:00
parent 2fdd3a9c36
commit 4b69c1f30a
3 changed files with 33 additions and 1 deletions

View File

@@ -67,3 +67,24 @@ jobs:
PCIT_MESSAGE: Sync from yeasy/docker_practice@${{github.sha}} by PCIT
PCIT_TARGET_BRANCH: master
PCIT_USERNAME: ptt0xjqzbke3
- name: Build vuepress docker image
if: github.repository == 'docker-practice/docker_practice'
run: |
sudo rm -rf .vuepress/dist/.git
echo "FROM nginx:alpine" >> Dockerfile
echo "COPY .vuepress/dist /usr/share/nginx/html" >> Dockerfile
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
VCS_REF=`git rev-parse --short HEAD`
docker build -t dockerpracticesig/docker_practice:vuepress \
--label org.opencontainers.image.revision=$VCS_REF \
--label org.opencontainers.image.source="https://github.com/yeasy/docker_practice" \
.
docker push dockerpracticesig/docker_practice:vuepress
env:
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}