From bfee57e339f2a716aa43d837d4294bea1620b58a Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Fri, 23 Apr 2021 16:22:48 +0530 Subject: [PATCH] update ci file experiment with yaml formatting devel branch now has docker tag devel and latest now refers to main --- .github/workflows/ci.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72802f7..75b8cd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,4 @@ +--- name: Continuous Integration on: pull_request: @@ -77,7 +78,9 @@ jobs: publish: name: Publish Release Docker Image needs: [build] - if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') + if: | + github.event_name != 'pull_request' && \ + (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) runs-on: ubuntu-latest env: CODEGEN_DB_HOST: localhost @@ -117,7 +120,14 @@ jobs: password: ${{ secrets.DOCKER_LOGIN_PASSWORD }} - name: Migrate run: csbt flyway/flywayMigrate - - name: Publish + - name: Publish Tag + if: startsWith(github.ref, 'refs/tags/v') + run: | + csbt docker:publish + - name: Publish Latest + if: github.ref == 'refs/heads/main' + env: + DOCKER_PUBLISH_TAG: latest run: | csbt docker:publish @@ -133,7 +143,7 @@ jobs: CODEGEN_DB_PASSWORD: postgres CODEGEN_DB_NAME: codegendb DOCKER_JAVA_IMAGE: azul/zulu-openjdk-alpine:11-jre-headless - DOCKER_PUBLISH_TAG: latest + DOCKER_PUBLISH_TAG: devel services: postgres: image: postgres:12-alpine