From 90351d72ce56daac14017dcdbcad253b7be89d4d Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Wed, 11 Aug 2021 07:49:42 +0100 Subject: [PATCH 01/10] Create cd-build.yml --- .github/workflows/cd-build.yml | 73 ++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/cd-build.yml diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml new file mode 100644 index 00000000..85b26f2f --- /dev/null +++ b/.github/workflows/cd-build.yml @@ -0,0 +1,73 @@ +name: CWL Viewer Docker Image Build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2.3.4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: MongoDB in GitHub Actions + uses: supercharge/mongodb-github-action@1.3.0 + + - name: Restore dependency cache + uses: actions/cache@v2.1.4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '8' + + - name: Install system packages + run: | + sudo apt-get -qq update + sudo apt-get install graphviz python3-pip + sudo pip install cwltool + + - name: Build and test with Maven + run: | + ./mvnw test -B + + - name: Coverage report + run: | + mvn prepare-package -DskipTests=true + mvn cobertura:cobertura coveralls:report --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }} + env: + CI_NAME: github + COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:version + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From a0c41efb7334aea2a6df2caca167654473da798f Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Wed, 11 Aug 2021 07:50:42 +0100 Subject: [PATCH 02/10] Create cd-build.yml --- cd-build.yml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 cd-build.yml diff --git a/cd-build.yml b/cd-build.yml new file mode 100644 index 00000000..85b26f2f --- /dev/null +++ b/cd-build.yml @@ -0,0 +1,73 @@ +name: CWL Viewer Docker Image Build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2.3.4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: MongoDB in GitHub Actions + uses: supercharge/mongodb-github-action@1.3.0 + + - name: Restore dependency cache + uses: actions/cache@v2.1.4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '8' + + - name: Install system packages + run: | + sudo apt-get -qq update + sudo apt-get install graphviz python3-pip + sudo pip install cwltool + + - name: Build and test with Maven + run: | + ./mvnw test -B + + - name: Coverage report + run: | + mvn prepare-package -DskipTests=true + mvn cobertura:cobertura coveralls:report --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }} + env: + CI_NAME: github + COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:version + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From d1aea92cca66d7882f8a184268b0d0dcda9b52fd Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Wed, 11 Aug 2021 07:57:22 +0100 Subject: [PATCH 03/10] Create main.yml --- .github/workflows/main.yml | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..3842cbf8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,73 @@ +name: Docker Image Build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2.3.4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: MongoDB in GitHub Actions + uses: supercharge/mongodb-github-action@1.3.0 + + - name: Restore dependency cache + uses: actions/cache@v2.1.4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '8' + + - name: Install system packages + run: | + sudo apt-get -qq update + sudo apt-get install graphviz python3-pip + sudo pip install cwltool + + - name: Build and test with Maven + run: | + ./mvnw test -B + + - name: Coverage report + run: | + mvn prepare-package -DskipTests=true + mvn cobertura:cobertura coveralls:report --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }} + env: + CI_NAME: github + COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:version + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From ff1931f5c92b0402803a329463bebccf41681d75 Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Wed, 11 Aug 2021 08:06:02 +0100 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3842cbf8..05ad8b0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v + uses: docker/setup-buildx-action@v1 - name: Build and push id: docker_build From d4e924c585f1eec4cd5d7aa382faa39e3a02876c Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:09:20 +0100 Subject: [PATCH 05/10] Update main.yml --- .github/workflows/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05ad8b0e..8a4dea4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,12 @@ jobs: - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - + + - name: Set Date + run: | + VERSION=$(date +%s) + echo ${VERSION} + - name: Build and push id: docker_build uses: docker/build-push-action@v2 @@ -67,7 +72,8 @@ jobs: context: ./ file: ./Dockerfile push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:version + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} +:v - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From 33c94f77735fe52cb2ba7c62b2748e9badab3166 Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:09:53 +0100 Subject: [PATCH 06/10] Update main.yml --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a4dea4f..8ffc6066 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,7 +73,6 @@ jobs: file: ./Dockerfile push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} -:v - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From 14f5e25df6c4d1a60d27a7deaaa8bef0f204a361 Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:22:21 +0100 Subject: [PATCH 07/10] Update main.yml --- .github/workflows/main.yml | 50 +++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ffc6066..da14479b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,29 +50,35 @@ jobs: CI_NAME: github COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Set Date + - name: Build and Push run: | VERSION=$(date +%s) - echo ${VERSION} + docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + docker build . --file Dockerfile --tag ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} + docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} +# - name: Login to Docker Hub +# uses: docker/login-action@v1 +# with: +# username: ${{ secrets.DOCKER_HUB_USERNAME }} +# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + +# - name: Set up Docker Buildx +# id: buildx +# uses: docker/setup-buildx-action@v1 - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} +# - name: Set Date +# run: | +# VERSION=$(date +%s) +# echo ${VERSION} + +# - name: Build and push +# id: docker_build +# uses: docker/build-push-action@v2 +# with: +# context: ./ +# file: ./Dockerfile +# push: true +# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} +# - name: Image digest +# run: echo ${{ steps.docker_build.outputs.digest }} From faa6d2ba9e13f94595b8293f13ae8d59c7cfd6bf Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:32:22 +0100 Subject: [PATCH 08/10] Update and rename main.yml to cd-build.yml --- .github/workflows/{main.yml => cd-build.yml} | 26 -------------------- 1 file changed, 26 deletions(-) rename .github/workflows/{main.yml => cd-build.yml} (68%) diff --git a/.github/workflows/main.yml b/.github/workflows/cd-build.yml similarity index 68% rename from .github/workflows/main.yml rename to .github/workflows/cd-build.yml index da14479b..218dc652 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/cd-build.yml @@ -56,29 +56,3 @@ jobs: docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker build . --file Dockerfile --tag ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} -# - name: Login to Docker Hub -# uses: docker/login-action@v1 -# with: -# username: ${{ secrets.DOCKER_HUB_USERNAME }} -# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - -# - name: Set up Docker Buildx -# id: buildx -# uses: docker/setup-buildx-action@v1 - -# - name: Set Date -# run: | -# VERSION=$(date +%s) -# echo ${VERSION} - -# - name: Build and push -# id: docker_build -# uses: docker/build-push-action@v2 -# with: -# context: ./ -# file: ./Dockerfile -# push: true -# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} - -# - name: Image digest -# run: echo ${{ steps.docker_build.outputs.digest }} From 36e8c661a2720726cd4464d5bebf83cc3f3ff0b6 Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki Date: Mon, 16 Aug 2021 17:22:37 +0100 Subject: [PATCH 09/10] Remove redundant file --- cd-build.yml | 73 ---------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 cd-build.yml diff --git a/cd-build.yml b/cd-build.yml deleted file mode 100644 index 85b26f2f..00000000 --- a/cd-build.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: CWL Viewer Docker Image Build - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2.3.4 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: MongoDB in GitHub Actions - uses: supercharge/mongodb-github-action@1.3.0 - - - name: Restore dependency cache - uses: actions/cache@v2.1.4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up Java - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '8' - - - name: Install system packages - run: | - sudo apt-get -qq update - sudo apt-get install graphviz python3-pip - sudo pip install cwltool - - - name: Build and test with Maven - run: | - ./mvnw test -B - - - name: Coverage report - run: | - mvn prepare-package -DskipTests=true - mvn cobertura:cobertura coveralls:report --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }} - env: - CI_NAME: github - COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/test:version - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} From ce1f71c7f017883a198f4d93abf3a21129db1e83 Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki <12957252+obasekiosa@users.noreply.github.com> Date: Wed, 13 Oct 2021 08:20:27 +0100 Subject: [PATCH 10/10] Update cd-build.yml workflow now runs only if CWL Viewer Build workflow completes --- .github/workflows/cd-build.yml | 51 +++++++--------------------------- 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml index 218dc652..7e7ed73c 100644 --- a/.github/workflows/cd-build.yml +++ b/.github/workflows/cd-build.yml @@ -1,12 +1,14 @@ name: Docker Image Build on: - push: - branches: - - main + workflow_run: + workflows: ["CWL Viewer Build"] + branches: [main] + types: + - completed jobs: - build: + build-image: runs-on: ubuntu-20.04 steps: @@ -15,44 +17,11 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: MongoDB in GitHub Actions - uses: supercharge/mongodb-github-action@1.3.0 - - - name: Restore dependency cache - uses: actions/cache@v2.1.4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up Java - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '8' - - - name: Install system packages - run: | - sudo apt-get -qq update - sudo apt-get install graphviz python3-pip - sudo pip install cwltool - - - name: Build and test with Maven - run: | - ./mvnw test -B - - - name: Coverage report - run: | - mvn prepare-package -DskipTests=true - mvn cobertura:cobertura coveralls:report --no-transfer-progress -DrepoToken=$COVERALLS_SECRET -DpullRequest=${{ github.event.number }} - env: - CI_NAME: github - COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and Push + - name: Docker Image Build and Push run: | - VERSION=$(date +%s) + DATE=$(date +%s) + GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") + VERSION= ${GIT_HASH}-${DATE} docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker build . --file Dockerfile --tag ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION} docker push ${{ secrets.DOCKER_HUB_USERNAME }}/cwlviewer:${VERSION}