From 642afb5adbbf061f6c103bdfa1f694bdfe0c81a3 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 5 Oct 2020 13:51:44 +0100 Subject: [PATCH 1/6] added git actions workflow file --- github/workflows/dockerhub-publish-dev.yml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 github/workflows/dockerhub-publish-dev.yml diff --git a/github/workflows/dockerhub-publish-dev.yml b/github/workflows/dockerhub-publish-dev.yml new file mode 100644 index 00000000000..f025e2ab2da --- /dev/null +++ b/github/workflows/dockerhub-publish-dev.yml @@ -0,0 +1,32 @@ +name: dockerhub-publish + +on: + push: + branches: develop + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:dev + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From 43cb227e981a887b2f21eb97f44d8de8037e6310 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Oct 2020 13:40:41 +0100 Subject: [PATCH 2/6] added latest build for master branch --- .github/workflows/dockerhub-publish-dev.yml | 32 +++++++++++++++++++++ .github/workflows/dockerhub-publish.yml | 32 +++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/dockerhub-publish-dev.yml create mode 100644 .github/workflows/dockerhub-publish.yml diff --git a/.github/workflows/dockerhub-publish-dev.yml b/.github/workflows/dockerhub-publish-dev.yml new file mode 100644 index 00000000000..00fab4129a1 --- /dev/null +++ b/.github/workflows/dockerhub-publish-dev.yml @@ -0,0 +1,32 @@ +name: dockerhub-publish-develop + +on: + push: + branches: develop + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:develop + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/dockerhub-publish.yml new file mode 100644 index 00000000000..0737849e93c --- /dev/null +++ b/.github/workflows/dockerhub-publish.yml @@ -0,0 +1,32 @@ +name: dockerhub-publish-latest + +on: + push: + branches: master + +jobs: + main: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:latest + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From 27034923f92ec61d756fc0f533372d35b5b07c0b Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Oct 2020 13:42:48 +0100 Subject: [PATCH 3/6] wrong dir, moved file --- github/workflows/dockerhub-publish-dev.yml | 32 ---------------------- 1 file changed, 32 deletions(-) delete mode 100644 github/workflows/dockerhub-publish-dev.yml diff --git a/github/workflows/dockerhub-publish-dev.yml b/github/workflows/dockerhub-publish-dev.yml deleted file mode 100644 index f025e2ab2da..00000000000 --- a/github/workflows/dockerhub-publish-dev.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: dockerhub-publish - -on: - push: - branches: develop - -jobs: - main: - runs-on: ubuntu-latest - steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: openmc/openmc:dev - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} From 986dc94aedd86aae727b0485798d3b5dc93d556a Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Oct 2020 13:48:48 +0100 Subject: [PATCH 4/6] changed trigger to on PR to test if secrets work --- .github/workflows/dockerhub-publish-dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dockerhub-publish-dev.yml b/.github/workflows/dockerhub-publish-dev.yml index 00fab4129a1..0a08f848c80 100644 --- a/.github/workflows/dockerhub-publish-dev.yml +++ b/.github/workflows/dockerhub-publish-dev.yml @@ -3,6 +3,8 @@ name: dockerhub-publish-develop on: push: branches: develop + pull_request: + branches: develop jobs: main: From 4068bb8ac51d0431f6c8aec8aa56998acafd12e1 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Oct 2020 13:56:01 +0100 Subject: [PATCH 5/6] removed PR trigger --- .github/workflows/dockerhub-publish-dev.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dockerhub-publish-dev.yml b/.github/workflows/dockerhub-publish-dev.yml index 0a08f848c80..00fab4129a1 100644 --- a/.github/workflows/dockerhub-publish-dev.yml +++ b/.github/workflows/dockerhub-publish-dev.yml @@ -3,8 +3,6 @@ name: dockerhub-publish-develop on: push: branches: develop - pull_request: - branches: develop jobs: main: From 7a6b5fc62ea00fc72ae43b0cb8e9284abecb44d9 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 19 Oct 2020 22:56:55 +0100 Subject: [PATCH 6/6] added dockerhub action for release --- .../workflows/dockerhub-publish-release.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/dockerhub-publish-release.yml diff --git a/.github/workflows/dockerhub-publish-release.yml b/.github/workflows/dockerhub-publish-release.yml new file mode 100644 index 00000000000..d8de72618d5 --- /dev/null +++ b/.github/workflows/dockerhub-publish-release.yml @@ -0,0 +1,35 @@ +name: dockerhub-publish-release + +on: + push: + tags: 'v*.*.*' + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: openmc/openmc:${{ env.RELEASE_VERSION }} + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}