From 4097819fa31aacbb7b21240da5d6bbf9861d0eca Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Thu, 28 Jan 2021 10:06:43 -0500 Subject: [PATCH] Removing old files --- .github/workflows/chat-ops.yml | 20 ------- .github/workflows/cleanup-pr.yml | 19 ------ .github/workflows/deploy-pr.yml | 89 ---------------------------- .github/workflows/deploy-prod.yml | 64 -------------------- .github/workflows/deploy-staging.yml | 68 --------------------- 5 files changed, 260 deletions(-) delete mode 100644 .github/workflows/chat-ops.yml delete mode 100644 .github/workflows/cleanup-pr.yml delete mode 100644 .github/workflows/deploy-pr.yml delete mode 100644 .github/workflows/deploy-prod.yml delete mode 100644 .github/workflows/deploy-staging.yml diff --git a/.github/workflows/chat-ops.yml b/.github/workflows/chat-ops.yml deleted file mode 100644 index a3f52bd..0000000 --- a/.github/workflows/chat-ops.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Chatops -on: - issue_comment: - types: [created] - -jobs: - command-dispatch: - runs-on: ubuntu-latest - if: startsWith(github.event.comment.body, '/deploy') || startsWith(github.event.comment.body, '/swap') - steps: - - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v2 - with: - token: ${{ secrets.CHAT_OPS_TOKEN }} - reaction-token: ${{ github.token }} - commands: | - deploy - swap - permission: admin - issue-type: pull-request diff --git a/.github/workflows/cleanup-pr.yml b/.github/workflows/cleanup-pr.yml deleted file mode 100644 index 29918c6..0000000 --- a/.github/workflows/cleanup-pr.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Cleanup PR -on: - pull_request: - types: [closed] - branches: master - -jobs: - delete-review-slot: - runs-on: ubuntu-latest - steps: - - name: Azure login - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_SUBSCRIPTION_SECRET }} - - - name: Create deployment slot - continue-on-error: true - run: | - az webapp deployment slot delete --name popular-repos --slot review-pr-${{ github.event.number }} --resource-group pied-piper-inc diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml deleted file mode 100644 index 7236b69..0000000 --- a/.github/workflows/deploy-pr.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Deploy to Azure for Review -on: - pull_request: - branches: - - master -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup node 12 - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: Cache node modules - id: cache-node - uses: actions/cache@v1 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Install dependencies - if: steps.cache-node.outputs.cache-hit != 'true' - run: | - npm install --silent - - - name: Build site - run: npm run build - - - name: Build popular-repos image - uses: docker/build-push-action@v1 - with: - username: ${{secrets.AZURE_REGISTRY_USER}} - password: ${{secrets.AZURE_REGISTRY_PASS}} - registry: ${{ secrets.AZURE_REGISTRY_NAME }} - tags: ${{ github.event.pull_request.head.sha }} - repository: popular-repos-old - cache_froms: popular-repos-old:latest - - deploy_to_azure: - name: Deploy - runs-on: ubuntu-latest - needs: build - steps: - - name: Azure login - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_SUBSCRIPTION_SECRET }} - - - uses: chrnorm/deployment-action@v1.2.0 - name: Create GitHub deployment - id: deployment - with: - token: ${{github.token }} - ref: ${{ github.event.pull_request.head.sha }} - environment: review-pr-${{ github.event.number }} - - - name: Create deployment slot - run: | - az webapp deployment slot create --name popular-repos-old --resource-group pied-piper-inc --slot review-pr-${{ github.event.number }} --configuration-source popular-repos - - - name: Deploy popular repos - uses: azure/webapps-deploy@v2 - id: popular-repos-web - with: - app-name: 'popular-repos-old' - images: '${{ secrets.AZURE_REGISTRY_NAME }}/popular-repos-old:${{ github.event.pull_request.head.sha }}' - slot-name: review-pr-${{ github.event.number }} - - - name: Update deployment status (success) - if: success() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - target_url: ${{ steps.popular-repos-web.outputs.webapp-url }} - state: "success" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Update deployment status (failure) - if: failure() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - state: "failure" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml deleted file mode 100644 index c8cba7b..0000000 --- a/.github/workflows/deploy-prod.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Deploy to production - -on: - repository_dispatch: - types: [swap-command] - -jobs: - deploy-prod: - name: Deploy - runs-on: ubuntu-latest - steps: - - name: Azure login - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_SUBSCRIPTION_SECRET }} - - - uses: chrnorm/deployment-action@v1.2.0 - name: Create GitHub deployment - id: deployment - with: - token: ${{github.token }} - ref: ${{ github.event.client_payload.pull_request.head.sha }} - environment: production - - - name: Swap staging to production - run: | - az webapp deployment slot swap --name popular-repos --resource-group pied-piper-inc --slot staging --target-slot production - - - name: Update deployment status (success) - if: success() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - target_url: http://popular-repos.azurewebsites.net - state: "success" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Comment on success - if: success() - uses: peter-evans/create-or-update-comment@v1.4.1 - with: - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction: hooray - body: | - Successfully deployed [PR-${{ github.event.client_payload.pull_request.number }}](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }}) to [production](http://popular-repos.azurewebsites.net) - - - name: Update deployment status (failure) - if: failure() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - state: "failure" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Comment on failure - if: failure() - uses: peter-evans/create-or-update-comment@v1.4.1 - with: - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction: eyes, confused - body: | - Failed to deploy #${{ github.event.client_payload.pull_request.number }} to production - - See https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml deleted file mode 100644 index 9fbb7ca..0000000 --- a/.github/workflows/deploy-staging.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Deploy to staging -on: - repository_dispatch: - types: [deploy-command] - -jobs: - deploy-staging: - name: Deploy - runs-on: ubuntu-latest - steps: - - name: Azure login - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_SUBSCRIPTION_SECRET }} - - - uses: chrnorm/deployment-action@v1.2.0 - name: Create GitHub deployment - id: deployment - with: - token: ${{github.token }} - ref: ${{ github.event.client_payload.pull_request.head.sha }} - environment: staging - - - name: Deploy popular repos - uses: azure/webapps-deploy@v2 - id: popular-repos-web - with: - app-name: 'popular-repos' - images: '${{ secrets.AZURE_REGISTRY_NAME }}/popular-repos:${{ github.event.client_payload.pull_request.head.sha}}' - slot-name: staging - - - name: Update deployment status (success) - if: success() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - target_url: ${{ steps.popular-repos-web.outputs.webapp-url }} - state: "success" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Comment on success - if: success() - uses: peter-evans/create-or-update-comment@v1.4.1 - with: - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction: hooray - body: | - Successfully deployed [PR-${{ github.event.client_payload.pull_request.number }}](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }}) to [staging](${{ steps.popular-repos-web.outputs.webapp-url }}) - - - - name: Update deployment status (failure) - if: failure() - uses: chrnorm/deployment-status@releases/v1 - with: - token: "${{ github.token }}" - state: "failure" - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - - - name: Comment on failure - if: failure() - uses: peter-evans/create-or-update-comment@v1.4.1 - with: - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction: eyes, confused - body: | - Failed to deploy #${{ github.event.client_payload.pull_request.number }} to staging - - See https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }}