From 06b66fb05524826522fd558baea8ad9bca0378fe Mon Sep 17 00:00:00 2001 From: Javier Criado Marcos Date: Wed, 23 Mar 2022 16:00:17 +0000 Subject: [PATCH] feature: add pipeline for publish docker image Signed-off-by: Javier Criado Marcos --- .github/workflows/build-workflow.yaml | 25 +++++----------------- .github/workflows/release-workflow.yaml | 28 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/release-workflow.yaml diff --git a/.github/workflows/build-workflow.yaml b/.github/workflows/build-workflow.yaml index 70379f8a..ffdca68c 100644 --- a/.github/workflows/build-workflow.yaml +++ b/.github/workflows/build-workflow.yaml @@ -1,6 +1,10 @@ name: build-workflow # This workflow is triggered on pushes to the repository. -on: [push, pull_request] +on: + push: + branches: + - "*" + pull_request: jobs: build: @@ -33,22 +37,3 @@ jobs: run: | cd charts PATH=$PATH:/tmp/bin helm upgrade --install --set image.tag=v$GITHUB_SHA_SHORT --set rbac.create=true --wait --timeout 60s log-router ./log-router - publish: - name: publish-job - if: startsWith(github.ref, 'refs/heads/release') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: FranzDiebold/github-env-vars-action@v1.2.1 - - name: docker-login - run: | - cd config-reloader && make docker-login - env: # Or as an environment variable - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - name: build-base - run: | - cd base-image && make build-image - - name: push-image - run: | - cd config-reloader && make push-image \ No newline at end of file diff --git a/.github/workflows/release-workflow.yaml b/.github/workflows/release-workflow.yaml new file mode 100644 index 00000000..e8414f7a --- /dev/null +++ b/.github/workflows/release-workflow.yaml @@ -0,0 +1,28 @@ +name: build-workflow +# This workflow is triggered on pushes to the repository. +on: + push: + tags: + - '*' + +jobs: + publish: + name: publish-job + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: FranzDiebold/github-env-vars-action@v1.2.1 + - name: docker-login + run: | + cd config-reloader && make docker-login + env: # Or as an environment variable + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + - name: build-base + run: | + cd base-image && make build-image + - name: push-image + run: | + cd config-reloader && make push-image + env: + TAG: ${{github.ref_name}} \ No newline at end of file