Skip to content

Commit

Permalink
Actions: Reorganised workflow (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
pozgo committed May 7, 2020
1 parent 51dc05d commit 8dfa6c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Docker Image MKDocs
name: Build & Test MKDocs

on:
push:
branches: [ master, issue/* ]
branches: [ issue/*, feature/* ]
pull_request:
branches: [ master ]

Expand All @@ -18,16 +18,9 @@ jobs:
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker build . --file Dockerfile --tag polinux/mkdocs:${RELEASE}
docker images
- name: Test image
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker run -d --cap-add NET_ADMIN -p 8000:8000 --name mkdocs polinux/mkdocs:${RELEASE}
sleep 10
curl -sSLi http://127.0.0.1:8000 | grep '200 OK'
- name: Deploy image
if: ${{github.branch == 'master'}}
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASS }}
docker push polinux/mkdocs:${RELEASE}
20 changes: 20 additions & 0 deletions .github/workflows/deploy_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy MKDocs

on:
push:
branches: [ master ]

jobs:

deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Deploy image
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker build . --file Dockerfile --tag polinux/mkdocs:${RELEASE}
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASS }}
docker push polinux/mkdocs:${RELEASE}

0 comments on commit 8dfa6c5

Please sign in to comment.