From e28ef8186491a96ccbded910de31a8666d50a9bd Mon Sep 17 00:00:00 2001 From: Augustas Vilcinskas Date: Wed, 24 Apr 2024 12:37:07 +0200 Subject: [PATCH] Adjust workflows, remove irrelavant ones --- .github/dependabot.yml | 31 -------- .github/workflows/build-images.yaml | 53 +++++-------- .github/workflows/e2e-tests.yaml | 94 ----------------------- .github/workflows/helm-chart-release.yaml | 33 -------- 4 files changed, 21 insertions(+), 190 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/e2e-tests.yaml delete mode 100644 .github/workflows/helm-chart-release.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 848221e4f4..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: 2 -updates: - # github actions - - package-ecosystem: "github-actions" - # checks workflow files in /.github/workflows - directory: "/" - schedule: - interval: "daily" - - # Go - - package-ecosystem: "gomod" - # checks /go.mod - directory: "/" - schedule: - interval: "daily" - - # Docker - - package-ecosystem: "docker" - # checks /Dockerfile - directory: "/" - schedule: - interval: "daily" - - # Python (PRs disabled) - - package-ecosystem: "pip" - # checks /docs/requirements.txt - directory: "/docs" - schedule: - interval: "weekly" - # Allow up to 0 open pull requests for pip dependencies - open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 2f7cb21160..67c99c4aaf 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -11,12 +11,19 @@ on: branches: - master +env: + image_registry: europe-west4-docker.pkg.dev/ivido-development + jobs: - docker: + build-push: runs-on: ubuntu-latest + steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Set version params id: version @@ -34,41 +41,23 @@ jobs: - name: Docker meta id: docker_meta - uses: docker/metadata-action@v4 - with: - images: nutsfoundation/nuts-node - tags: | - # generate 'master' tag for the master branch - type=ref,event=branch,enable={{is_default_branch}},prefix= - # generate v5.2.1 tag - type=semver,pattern={{version}} - # generate v5 tag - type=semver,pattern={{major}} - flavor: | - latest=auto - prefix=v,onlatest=false - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - if: ${{ github.event_name != 'pull_request' }} - uses: docker/login-action@v2 + - name: Login to image registry + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: europe-west4-docker.pkg.dev + username: _json_key + password: ${{ secrets.GCP_KEY }} - - name: Build and push - uses: docker/build-push-action@v4 + - name: Build and push to registry + uses: docker/build-push-action@v5 with: context: . - file: Dockerfile - platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.docker_meta.outputs.tags }} + tags: | + ${{ env.image_registry }}/formelio/nuts-node:${{ steps.version.outputs.git_version }} + cache-from: type=registry,ref=${{ inputs.image_registry }}/formelio/nuts-node:latest-cache + cache-to: type=registry,ref=${{ inputs.image_registry }}/formelio/nuts-node:latest-cache,mode=max build-args: | GIT_VERSION=${{ steps.version.outputs.git_version }} GIT_COMMIT=${{ steps.version.outputs.git_commit }} diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml deleted file mode 100644 index 48622529df..0000000000 --- a/.github/workflows/e2e-tests.yaml +++ /dev/null @@ -1,94 +0,0 @@ ---- -name: 'E2E tests' - -on: - push: - branches: - - master - tags: - - 'v*' - pull_request: - branches: - - master - - 'V*' - - -jobs: - e2e-test: - permissions: - packages: write - - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Setting git SHA to PR head - if: ${{ github.event_name == 'pull_request' }} - run: echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV - - - name: Setting git SHA to branch head - if: ${{ github.event_name != 'pull_request' }} - run: echo "SHA=${{ github.sha }}" >> $GITHUB_ENV - - - name: Build and push - uses: docker/build-push-action@v4 - if: ${{ github.actor != 'dependabot' }} - with: - context: . - file: Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} - tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }} - secrets: | - GIT_AUTH_TOKEN=${{ secrets.PACKAGE_SECRET }} - - - name: Build and push dependabot - uses: docker/build-push-action@v4 - if: ${{ github.actor == 'dependabot' }} - with: - context: . - file: Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} - tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }} - - - name: Run E2E tests - run: | - cd e2e-tests && \ - find . -type f -name "docker-compose.yml" | xargs -I{} sed -i 's~nutsfoundation/nuts-node:master~ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}~g' {} && \ - find . -type f -name "run-test.sh" | xargs -I{} sed -i 's/docker-compose exec/docker-compose exec -T/g' {} && \ - ./run-tests.sh - - - name: package cleanup - uses: bots-house/ghcr-delete-image-action@v1.1.0 - if: ${{ github.actor != 'dependabot' }} - with: - owner: nuts-foundation - name: nuts-node-ci - # NOTE: using Personal Access Token - token: ${{ secrets.PACKAGE_SECRET }} - tag: ${{ env.SHA }} - - - name: package cleanup dependabot - uses: bots-house/ghcr-delete-image-action@v1.1.0 - if: ${{ github.actor == 'dependabot' }} - with: - owner: nuts-foundation - name: nuts-node-ci - # NOTE: using Personal Access Token - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ env.SHA }} diff --git a/.github/workflows/helm-chart-release.yaml b/.github/workflows/helm-chart-release.yaml deleted file mode 100644 index f27ac2ae99..0000000000 --- a/.github/workflows/helm-chart-release.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Charts - -on: - push: - branches: - - 'master' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: Install Helm - uses: azure/setup-helm@v3.5 - with: - version: v3.8.0 - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.5.0 - env: - CR_CHARTS_DIR: charts - CR_PAGES_BRANCH: gh-pages - CR_SKIP_EXISTING: true - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file