From 33f5317b486e6d9e056824d5be8c0d91b3de004b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Mon, 21 Oct 2019 13:46:51 +0200 Subject: [PATCH] Added workflows publishing the 'master' container image (#718) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- .ci/publish-images.sh | 2 +- .github/workflows/publish-images.yaml | 17 +++++++++++++++++ .github/workflows/release.yaml | 9 ++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-images.yaml diff --git a/.ci/publish-images.sh b/.ci/publish-images.sh index d5b85cf5c..321272faa 100755 --- a/.ci/publish-images.sh +++ b/.ci/publish-images.sh @@ -5,7 +5,7 @@ OPERATOR_VERSION=${OPERATOR_VERSION:-$(git describe --tags)} ## if we are on a release tag, let's extract the version number ## the other possible value, currently, is 'master' (or another branch name) -## if we are not running in travis, it fallsback to the `git describe` above +## if we are not running in the CI, it fallsback to the `git describe` above if [[ $OPERATOR_VERSION == release* ]]; then OPERATOR_VERSION=$(echo ${OPERATOR_VERSION} | grep -Po "([\d\.]+)") MAJOR_MINOR=$(echo ${OPERATOR_VERSION} | awk -F. '{print $1"."$2}') diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml new file mode 100644 index 000000000..54bacbd61 --- /dev/null +++ b/.github/workflows/publish-images.yaml @@ -0,0 +1,17 @@ +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: "publishes the images" + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + OPERATOR_VERSION: master + run: ./.ci/publish-images.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 33a203c8a..87cf4e01b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,5 +11,12 @@ jobs: - uses: actions/checkout@v1 - name: "perform the release" env: - GH_WRITE_TOKEN: ${{ secrets. GH_WRITE_TOKEN }} + GH_WRITE_TOKEN: ${{ secrets.GH_WRITE_TOKEN }} run: ./.ci/release.sh + - name: "publishes the images" + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} + run: ./.ci/publish-images.sh