From 683cf95ca7c85c541d6259336b9521a69920170a Mon Sep 17 00:00:00 2001 From: Kang Huaishuai Date: Tue, 28 Apr 2020 22:39:47 +0800 Subject: [PATCH] build vuepress docker image Signed-off-by: Kang Huaishuai --- .github/workflows/check-link.yml | 3 +++ .github/workflows/ci.yaml | 21 +++++++++++++++++++++ .travis.yml | 10 +++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-link.yml b/.github/workflows/check-link.yml index 42fb287..2d75c1d 100644 --- a/.github/workflows/check-link.yml +++ b/.github/workflows/check-link.yml @@ -12,6 +12,7 @@ jobs: - uses: actions/checkout@master with: fetch-depth: 1 + # search Issues :-( - run: | docker run -i --rm \ -v $PWD:/mnt:ro \ @@ -56,6 +57,8 @@ jobs: "en.wikipedia.org/wiki/UnionFS",\ "product.china-pub.com",\ "union-click.jd.com",\ + "x.x.x.x/base",\ + "x.x.x.x:9000/minio/",\ "www.aliyun.com" \ --allow-dupe \ --skip-save-results \ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dc69604..8b4db36 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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}} diff --git a/.travis.yml b/.travis.yml index fb2dc2e..a43b38b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,14 +22,22 @@ after_success: - echo "COPY _book /usr/share/nginx/html" >> Dockerfile - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +- export VCS_REF=`git rev-parse --short HEAD` +- | + docker build \ + -t dockerpracticesig/docker_practice \ + -t dockerpracticesig/docker_practice:gitbook \ + --label org.opencontainers.image.revision=$VCS_REF \ + --label org.opencontainers.image.source="https://github.com/yeasy/docker_practice" \ + . -- docker build -t dockerpracticesig/docker_practice . - docker run -dit --rm -p 4000:80 dockerpracticesig/docker_practice - sleep 5 - curl 127.0.0.1:4000 - docker push dockerpracticesig/docker_practice +- docker push dockerpracticesig/docker_practice:gitbook - cd _book - rm -rf .github/workflows