@@ -111,19 +111,26 @@ jobs:
111111 - name : Get full tag
112112 id : full_tag
113113 run : echo ::set-output name=VERSION::${GITHUB_REF##*/}
114- - name : Docker build
114+ - name : Get major version
115+ id : versions
115116 run : |
116- docker build \
117- "$GITHUB_WORKSPACE" \
118- -f "$GITHUB_WORKSPACE/Dockerfile" \
119- -t build-image
120- - name : Deploy to Docker Hub
121- if : startsWith(github.ref, 'refs/tags/')
122- run : ./docker/ci-push $TAG
117+ echo ::set-output name=MAJOR::$(echo $VERSION | cut -d. -f1)
118+ echo ::set-output name=MINOR::$(echo $VERSION | cut -d. -f2)
123119 env :
124- DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
125- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
126- TAG : ${{ steps.full_tag.outputs.VERSION }}
120+ VERSION : ${{ steps.full_tag.outputs.VERSION }}
121+ - uses : docker/login-action@v1
122+ if : startsWith(github.ref, 'refs/tags/')
123+ with :
124+ username : ${{ secrets.DOCKERHUB_USERNAME }}
125+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
126+ - uses : docker/build-push-action@v2
127+ with :
128+ push : startsWith(github.ref, 'refs/tags/')
129+ tags : |
130+ postfacto/postfacto
131+ postfacto/postfacto:${{ steps.versions.outputs.MAJOR }}
132+ postfacto/postfacto:${{ steps.versions.outputs.MAJOR }}.${{ steps.versions.outputs.MINOR }}
133+ postfacto/postfacto:${{ steps.full_tag.outputs.VERSION }}
127134
128135 package-build :
129136 runs-on : ubuntu-20.04
@@ -200,19 +207,28 @@ jobs:
200207 - name : Get full tag
201208 id : full_tag
202209 run : echo ::set-output name=VERSION::${GITHUB_REF##*/}
203- - name : Smoke build
210+ - name : Get major version
211+ id : versions
204212 run : |
205- docker build \
206- "$GITHUB_WORKSPACE/smoke" \
207- -f "$GITHUB_WORKSPACE/docker/smoke/Dockerfile" \
208- -t build-image-smoke
209- - name : Deploy to Docker Hub
210- if : startsWith(github.ref, 'refs/tags/')
211- run : ./docker/ci-push-smoke $TAG
213+ echo ::set-output name=MAJOR::$(echo $VERSION | cut -d. -f1)
214+ echo ::set-output name=MINOR::$(echo $VERSION | cut -d. -f2)
212215 env :
213- DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
214- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
215- TAG : ${{ steps.full_tag.outputs.VERSION }}
216+ VERSION : ${{ steps.full_tag.outputs.VERSION }}
217+ - uses : docker/login-action@v1
218+ if : startsWith(github.ref, 'refs/tags/')
219+ with :
220+ username : ${{ secrets.DOCKERHUB_USERNAME }}
221+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
222+ - uses : docker/build-push-action@v2
223+ with :
224+ context : ./smoke
225+ file : ./docker/smoke/Dockerfile
226+ push : startsWith(github.ref, 'refs/tags/')
227+ tags : |
228+ postfacto/smoke
229+ postfacto/smoke:${{ steps.versions.outputs.MAJOR }}
230+ postfacto/smoke:${{ steps.versions.outputs.MAJOR }}.${{ steps.versions.outputs.MINOR }}
231+ postfacto/smoke:${{ steps.full_tag.outputs.VERSION }}
216232
217233 cf-deploy :
218234 runs-on : ubuntu-20.04
@@ -261,3 +277,27 @@ jobs:
261277 git config --global user.email "postfacto@pivotal.io"
262278 git config --global user.name "Postfacto Robot"
263279 - run : ./test-package.sh --skip-package --skip-cf
280+
281+ docker-smoke :
282+ runs-on : ubuntu-20.04
283+ if : startsWith(github.ref, 'refs/tags/')
284+ needs :
285+ - docker-build
286+ - smoke-build
287+ steps :
288+ - uses : actions/checkout@v2
289+ - uses : docker/setup-buildx-action@v1
290+ - name : Get full tag
291+ id : full_tag
292+ run : echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
293+ - name : Smoke test Docker containers
294+ run : |
295+ docker-compose run setup
296+ docker-compose run test
297+ working-directory : docker/smoke/
298+ env :
299+ ADMIN_EMAIL : ' admin@example.com'
300+ ADMIN_PASSWORD : ' opensesame'
301+ POSTGRES_PASSWORD : ' friend'
302+ SECRET_KEY_BASE : ' supersecret'
303+ TAG : ${{ steps.full_tag.outputs.VERSION }}
0 commit comments