From 1df9f351b4bf626d399d155d13b96b9311f3d8d9 Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Tue, 13 Feb 2024 23:12:30 -0500 Subject: [PATCH] switch to new deployment method --- .github/workflows/build-deploy-release.yaml | 47 +++++++++--------- .github/workflows/build-main.yml | 48 +++++++++---------- .github/workflows/deploy-production.yaml | 20 ++++---- .github/workflows/manual-deploy-unstable.yaml | 36 ++++---------- 4 files changed, 61 insertions(+), 90 deletions(-) diff --git a/.github/workflows/build-deploy-release.yaml b/.github/workflows/build-deploy-release.yaml index 1b7c0a7..a3f8e7d 100644 --- a/.github/workflows/build-deploy-release.yaml +++ b/.github/workflows/build-deploy-release.yaml @@ -17,31 +17,28 @@ jobs: dockerfile: Dockerfile secrets: inherit - scan-image: - needs: build-production - runs-on: ubuntu-latest - steps: - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - image-ref: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' + #scan-image: + #needs: build-production + #runs-on: ubuntu-latest + #steps: + #- name: Run Trivy vulnerability scanner + #uses: aquasecurity/trivy-action@master + #with: + #image-ref: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} + #format: 'table' + #exit-code: '1' + #ignore-unfixed: true + #vuln-type: 'os,library' + #severity: 'CRITICAL,HIGH' + deploy-production: needs: build-production - runs-on: ubuntu-latest - environment: production - steps: - - name: Deploy to Production - uses: mlibrary/deploy-to-kubernetes@v3 - with: - registry_token: ${{ secrets.GITHUB_TOKEN }} - image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} - cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }} - cluster_server: https://hatcher.kubernetes.lib.umich.edu - namespace_token: ${{ secrets.HATCHER_TOKEN }} - namespace: ${{ secrets.NAMESPACE }} + name: Deploy to production + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} + file: environments/browse/production/web-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 8d762a3..bf8324b 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -16,31 +16,27 @@ jobs: dockerfile: Dockerfile secrets: inherit - scan-image: - needs: build-unstable - runs-on: ubuntu-latest - steps: - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - image-ref: ${{ needs.build-unstable.outputs.image }} - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' + #scan-image: + #needs: build-unstable + #runs-on: ubuntu-latest + #steps: + #- name: Run Trivy vulnerability scanner + #uses: aquasecurity/trivy-action@master + #with: + #image-ref: ${{ needs.build-unstable.outputs.image }} + #format: 'table' + #exit-code: '1' + #ignore-unfixed: true + #vuln-type: 'os,library' + #severity: 'CRITICAL,HIGH' - deploy-testing: + deploy-unstable: needs: build-unstable - runs-on: ubuntu-latest - environment: testing - steps: - - name: Deploy to Testing - uses: mlibrary/deploy-to-kubernetes@v3 - with: - registry_token: ${{ secrets.GITHUB_TOKEN }} - image: ${{ needs.build-unstable.outputs.image }} - cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }} - cluster_server: https://hatcher.kubernetes.lib.umich.edu - namespace_token: ${{ secrets.HATCHER_TOKEN }} - namespace: ${{ secrets.NAMESPACE }} + name: Deploy to workshop + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: environments/browse/workshop/web-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index 2d8a25a..2af4c1d 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -19,15 +19,11 @@ jobs: deploy-production: needs: build-production - runs-on: ubuntu-latest - environment: production - steps: - - name: Deploy to Production - uses: mlibrary/deploy-to-kubernetes@v3 - with: - registry_token: ${{ secrets.GITHUB_TOKEN }} - image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.inputs.tag }} - cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }} - cluster_server: https://hatcher.kubernetes.lib.umich.edu - namespace_token: ${{ secrets.HATCHER_TOKEN }} - namespace: ${{ secrets.NAMESPACE }} + name: Deploy to production + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.inputs.tag }} + file: environments/browse/production/web-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/manual-deploy-unstable.yaml b/.github/workflows/manual-deploy-unstable.yaml index b04b33e..875950a 100644 --- a/.github/workflows/manual-deploy-unstable.yaml +++ b/.github/workflows/manual-deploy-unstable.yaml @@ -26,31 +26,13 @@ jobs: dockerfile: Dockerfile secrets: inherit - scan-image: + deploy-unstable: needs: build-unstable - runs-on: ubuntu-latest - steps: - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - image-ref: ${{ needs.build-unstable.outputs.image }} - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - - deploy: - needs: build-unstable - runs-on: ubuntu-latest - environment: ${{ github.event.inputs.deploy_environment }} - steps: - - name: Deploy to ${{ github.event.inputs.deploy_environment }} - uses: mlibrary/deploy-to-kubernetes@v3 - with: - registry_token: ${{ secrets.GITHUB_TOKEN }} - image: ${{ needs.build-unstable.outputs.image }} - cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }} - cluster_server: https://hatcher.kubernetes.lib.umich.edu - namespace_token: ${{ secrets.HATCHER_TOKEN }} - namespace: ${{ secrets.NAMESPACE }} + name: Deploy to workshop + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: environments/browse/workshop/web-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit