From e92fa87de4c1e33a601f2a258069dfa3280a0cb9 Mon Sep 17 00:00:00 2001 From: Karl Johan Grahn Date: Mon, 16 Sep 2024 14:23:24 +0200 Subject: [PATCH] update --- .github/workflows/pull_request.yml | 46 ++++-------------------------- .github/workflows/push.yml | 5 ++-- .github/workflows/release.yml | 2 +- 3 files changed, 10 insertions(+), 43 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c60235c..635a6f1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,7 +1,7 @@ name: Pull Request on: - pull_request_target: + pull_request: branches: - master @@ -13,9 +13,9 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest name: Build - if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" + if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" steps: - name: Check out code uses: actions/checkout@v2 @@ -57,7 +57,7 @@ jobs: run: | kubectl cluster-info kubectl create namespace test - + - name: Test run: make test OPERATOR_NAMESPACE=test USE_EXISTING_CLUSTER=true @@ -67,19 +67,13 @@ jobs: sha=${{ github.event.pull_request.head.sha }} tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}" echo "##[set-output name=GIT_TAG;]$(echo ${tag})" - + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Login to Registry - uses: docker/login-action@v1 - with: - username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }} - password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }} - - name: Generate image repository path run: | echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV @@ -90,39 +84,11 @@ jobs: context: . file: ${{ env.DOCKER_FILE_PATH }} pull: true - push: true + push: false build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }} cache-to: type=inline tags: | ${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }} labels: | org.opencontainers.image.source=${{ github.event.repository.clone_url }} - org.opencontainers.image.created=${{ steps.prep.outputs.created }} org.opencontainers.image.revision=${{ github.sha }} - - - name: Comment on PR - uses: mshick/add-pr-comment@v1 - env: - GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - with: - message: '@${{ github.actor }} Image is available for testing. `docker pull ${{ github.repository }}:${{ steps.generate_tag.outputs.GIT_TAG }}`' - allow-repeats: false - - - name: Notify Failure - if: failure() - uses: mshick/add-pr-comment@v1 - env: - GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - with: - message: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!' - allow-repeats: false - - - name: Notify Slack - uses: 8398a7/action-slack@v3 - if: always() # Pick up events even if the job fails or is canceled. - with: - status: ${{ job.status }} - fields: repo,author,action,eventName,ref,workflow - env: - GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 003dd53..2fb8510 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -148,7 +148,7 @@ jobs: - name: Update Chart CRDs run: make generate-crds - + # Publish helm chart - name: Publish Helm chart uses: stefanprodan/helm-gh-pages@master @@ -169,9 +169,10 @@ jobs: run: | git config --local user.email "stakater@gmail.com" git config --local user.name "stakater-user" - git status + git status git add . git commit -m "[skip-ci] Update artifacts" -a + - name: Push changes uses: ad-m/github-push-action@master with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77aa08d..0392a5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,4 +41,4 @@ jobs: fields: repo,author,action,eventName,ref,workflow env: GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}