From 8582030dbe52104e2187ba3ab0bbf4cefe914f97 Mon Sep 17 00:00:00 2001 From: francav Date: Wed, 8 May 2024 11:48:41 +0100 Subject: [PATCH] (gh-actions): renaming workflows --- .github/workflows/_disabled_deploy.yml | 203 ------------------------- .github/workflows/build.yml | 2 +- .github/workflows/docs_deploy.yml | 2 +- .github/workflows/gitops_update.yml | 2 +- 4 files changed, 3 insertions(+), 206 deletions(-) delete mode 100644 .github/workflows/_disabled_deploy.yml diff --git a/.github/workflows/_disabled_deploy.yml b/.github/workflows/_disabled_deploy.yml deleted file mode 100644 index d1277d91..00000000 --- a/.github/workflows/_disabled_deploy.yml +++ /dev/null @@ -1,203 +0,0 @@ -name: deploy(disabled) - -on: - workflow_dispatch: - -env: - REGISTRY: ghcr.io - REPOSITORY_OWNER: wkspower - KEYCLOAK_URL: https://login.wkspower.co - WKS_API_URL: https://api.wkspower.co - WKS_EMAIL_API_URL: https://api.wkspower.co/inbound - WKS_STORAGE_API_URL: https://api.wkspower.co - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v3 - - - name: Setup necessary env vars - run: | - version=${GITHUB_REF#"refs/tags/"} - major_minor=$(echo ${version} | sed -e 's/^refs\/heads\///') - sha_short=$(echo ${GITHUB_SHA} | cut -c 1-8) - echo "BUILD_VERSION=$major_minor-$sha_short" >> $GITHUB_ENV - - - name: Set up jdk 18 - uses: actions/setup-java@v3 - with: - java-version: '18' - distribution: 'temurin' - - - name: Set up maven - uses: stCarolas/setup-maven@v4.5 - with: - maven-version: 3.8.2 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build all for backend api - run: mvn -B package --file apps/java/pom.xml - - - name: Install dependencies for case-portal - run: yarn --cwd case-portal install - - - name: Build for case-portal - run: REACT_APP_KEYCLOAK_URL=${{ env.KEYCLOAK_URL }} REACT_APP_API_URL=${{ env.WKS_API_URL }} REACT_APP_STORAGE_URL=${{ env.WKS_STORAGE_API_URL }} yarn --cwd case-portal build - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push Docker image for storage-api - uses: docker/build-push-action@v2 - with: - context: ./storage-api - platforms: linux/amd64,linux/arm64 - file: storage-api/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/storage-api:${{ env.BUILD_VERSION }}" - - - name: Build and push Docker image for opa - uses: docker/build-push-action@v2 - with: - context: ./opa - platforms: linux/amd64,linux/arm64 - file: opa/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/opa:${{ env.BUILD_VERSION }}" - - - name: Build and push Docker image for c7-external-tasks - uses: docker/build-push-action@v2 - with: - context: ./c7-external-tasks - platforms: linux/amd64,linux/arm64 - file: c7-external-tasks/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/c7-external-tasks:${{ env.BUILD_VERSION }}" - - - name: Build and push Docker image for case-engine-rest-api - uses: docker/build-push-action@v2 - with: - context: ./case-engine-rest-api - platforms: linux/amd64,linux/arm64 - file: case-engine-rest-api/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-engine-rest-api:${{ env.BUILD_VERSION }}" - - - name: Build and push Docker image for demo-data-loader - uses: docker/build-push-action@v2 - with: - context: ./demo-data-loader - platforms: linux/amd64,linux/arm64 - file: demo-data-loader/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/demo-data-loader:${{ env.BUILD_VERSION }}" - - - name: Build and push Docker image for case-portal - uses: docker/build-push-action@v2 - with: - context: ./case-portal - platforms: linux/amd64,linux/arm64 - file: case-portal/deployments/Dockerfile - push: true - tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ env.BUILD_VERSION }}" - - deploy: - runs-on: ubuntu-latest - needs: [build] - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v3 - with: - repository: wkspower/wks-gitops - path: wks-gitops - token: ${{ secrets.GH_PAT }} - - - name: Setup necessary env vars - run: | - version=${GITHUB_REF#"refs/tags/"} - major_minor=$(echo ${version} | sed -e 's/^refs\/heads\///') - sha_short=$(echo ${GITHUB_SHA} | cut -c 1-8) - echo "BUILD_VERSION=$major_minor-$sha_short" >> $GITHUB_ENV - - - uses: supplypike/setup-bin@v3 - with: - uri: 'https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.0.0/kustomize_v5.0.0_linux_amd64.tar.gz' - name: 'kustomize' - version: '5.0.0' - - - name: Update kubernetes resources with new tag to Local Environment - run: | - cd wks-gitops/apps - - cd policy-decision-api/local - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/opa=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/opa:${{ env.BUILD_VERSION }} - cd ../../ - - cd case-engine-rest-api/local - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-engine-rest-api=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-engine-rest-api:${{ env.BUILD_VERSION }} - cd ../../ - - cd demo-data-loader/local - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/demo-data-loader=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/demo-data-loader:${{ env.BUILD_VERSION }} - cd ../../ - - cd c7-external-tasks/local - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/c7-external-tasks=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/c7-external-tasks:${{ env.BUILD_VERSION }} - cd ../../ - - cd case-portal-client/local - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ env.BUILD_VERSION }} - cd ../../ - - - name: Update kubernetes resources with new tag to Staging Environment - run: | - cd wks-gitops/apps - - cd storage-api/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/storage-api=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/storage-api:${{ env.BUILD_VERSION }} - cd ../../ - - cd policy-decision-api/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/opa=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/opa:${{ env.BUILD_VERSION }} - cd ../../ - - cd case-engine-rest-api/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-engine-rest-api=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-engine-rest-api:${{ env.BUILD_VERSION }} - cd ../../ - - cd demo-data-loader/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/demo-data-loader=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/demo-data-loader:${{ env.BUILD_VERSION }} - cd ../../ - - cd c7-external-tasks/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/c7-external-tasks=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/c7-external-tasks:${{ env.BUILD_VERSION }} - cd ../../ - - cd case-portal-client/staging - kustomize edit set image ${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal=${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ env.BUILD_VERSION }} - cd ../../ - - - name: New tag release for continuous delivery - run: | - cd wks-gitops - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "Release docker tag" - git push \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a54c6502..4306475d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build artifacts +name: Build Artifacts on: push: diff --git a/.github/workflows/docs_deploy.yml b/.github/workflows/docs_deploy.yml index 6f80e1c1..de978101 100644 --- a/.github/workflows/docs_deploy.yml +++ b/.github/workflows/docs_deploy.yml @@ -1,4 +1,4 @@ -name: deploy docs website +name: Deploy Docs on: push: diff --git a/.github/workflows/gitops_update.yml b/.github/workflows/gitops_update.yml index c5ec5f8c..247e1fba 100644 --- a/.github/workflows/gitops_update.yml +++ b/.github/workflows/gitops_update.yml @@ -1,4 +1,4 @@ -name: gitops_update +name: Gitops Update on: workflow_dispatch: