From e76c14f9e089d53dad4dc47c90a97639dccb528f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 3 Sep 2021 10:53:39 +0200 Subject: [PATCH] ci: run on pr and improve checking for push Signed-off-by: Jens Langhammer --- .github/workflows/ci-main.yml | 9 +++++++-- .github/workflows/ci-outpost.yml | 11 +++++++++-- .github/workflows/ci-web.yml | 5 +++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index f97d55c87..0237fadb4 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -2,8 +2,13 @@ name: authentik-ci-main on: push: + branches: + - master + - next + - version-* paths-ignore: - website + pull_request: env: POSTGRES_DB: authentik @@ -224,7 +229,7 @@ jobs: python ./scripts/gh_do_set_branch.py - name: Login to Container Registry uses: docker/login-action@v1 - if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} + if: ${{ secrets.HARBOR_USERNAME != "" }} with: registry: beryju.org username: ${{ secrets.HARBOR_USERNAME }} @@ -232,7 +237,7 @@ jobs: - name: Building Docker Image uses: docker/build-push-action@v2 with: - push: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} + push: ${{ secrets.HARBOR_USERNAME != "" }} tags: | beryju.org/authentik/server:gh-${{ steps.ev.outputs.branchName }} beryju.org/authentik/server:gh-${{ steps.ev.outputs.branchName }}-${{ steps.ev.outputs.timestamp }} diff --git a/.github/workflows/ci-outpost.yml b/.github/workflows/ci-outpost.yml index a225d4152..e069bd0f0 100644 --- a/.github/workflows/ci-outpost.yml +++ b/.github/workflows/ci-outpost.yml @@ -2,6 +2,11 @@ name: authentik-ci-outpost on: push: + branches: + - master + - next + - version-* + pull_request: jobs: lint-golint: @@ -43,11 +48,13 @@ jobs: uses: docker/setup-buildx-action@v1 - name: prepare variables id: ev + env: + DOCKER_USERNAME: ${{ secrets.HARBOR_USERNAME }} run: | python ./scripts/gh_do_set_branch.py - name: Login to Container Registry uses: docker/login-action@v1 - if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} + if: ${{ secrets.HARBOR_USERNAME != "" }} with: registry: beryju.org username: ${{ secrets.HARBOR_USERNAME }} @@ -55,7 +62,7 @@ jobs: - name: Building Docker Image uses: docker/build-push-action@v2 with: - push: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} + push: ${{ secrets.HARBOR_USERNAME != "" }} tags: | beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }} beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}-${{ steps.ev.outputs.timestamp }} diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index ce131b98d..cd518ee8e 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -2,6 +2,11 @@ name: authentik-ci-web on: push: + branches: + - master + - next + - version-* + pull_request: jobs: lint-eslint: