Skip to content

Commit

Permalink
Merge pull request #3148 from bitzesty/pb/remove-auto-deploy-actions-…
Browse files Browse the repository at this point in the history
…from-ci

Remove deploy jobs from github/workflows/ci.yml
  • Loading branch information
phil-l-brockwell authored Nov 27, 2024
2 parents 03e62ef + ff22c29 commit 2062250
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 97 deletions.
83 changes: 0 additions & 83 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,86 +81,3 @@ jobs:
bundler-cache: true
- name: Lint Ruby files
run: bundle exec rubocop --require rubocop-rails --format github
deploy_dev:
needs: [test]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby-version }}
- uses: actions/setup-node@v2-beta
with:
node-version: '20'
- name: 'Deploy dev'
env:
name: dev
url: 'https://dev.queens-awards-enterprise.service.gov.uk/'
CF_ENDPOINT: 'api.london.cloud.service.gov.uk'
CF_SPACE: dev
CF_APP: qae-dev
CF_USER: ${{ secrets.CF_USER }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
CF_ORG: ${{ secrets.CF_ORG }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
npm install -g yarn
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb [trusted=yes] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf7-cli
cf -v
cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
cf install-plugin blue-green-deploy -r CF-Community -f
./bin/deploy
deploy_staging:
needs: [test]
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby-version }}
- uses: actions/setup-node@v2-beta
with:
node-version: '20'
- name: 'Deploy staging'
env:
name: staging
url: 'https://staging.queens-awards-enterprise.service.gov.uk/'
CF_ENDPOINT: 'api.london.cloud.service.gov.uk'
CF_SPACE: staging
CF_APP: qae-staging
CF_USER: ${{ secrets.CF_USER }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
CF_ORG: ${{ secrets.CF_ORG }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: |
curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&source=github'
sudo dpkg -i cf-cli_amd64.deb
cf -v
cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
cf install-plugin blue-green-deploy -r CF-Community -f
./bin/deploy
17 changes: 3 additions & 14 deletions .github/workflows/slack_notification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for tests or deployment results
name: Check for workflow results
on:
workflow_run:
workflows: ["CI","Dev deployment","Staging deployment","Production deployment"]
Expand Down Expand Up @@ -28,22 +28,11 @@ jobs:
done
echo "::set-output name=suid::$suid"
- name: tests
- name: workflow-complete
uses: ravsamhq/notify-slack-action@v2
if: ${{ github.event.workflow_run.head_branch != 'main' && github.event.workflow_run.head_branch != 'staging' && github.event.workflow_run.head_branch != 'production' }}
with:
status: ${{ github.event.workflow_run.conclusion }}
notification_title: "Tests ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
message_format: "{emoji} *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <{repo_url}|{repo}>"
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
mention_users: ${{ steps.extract_slack_id.outputs.suid }}
mention_users_when: "failure,warnings"
- name: deployment
uses: ravsamhq/notify-slack-action@v2
if: ${{ github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'staging' || github.event.workflow_run.head_branch == 'production' }}
with:
status: ${{ github.event.workflow_run.conclusion }}
notification_title: "Deployment ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
notification_title: "Workflow ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
message_format: "{emoji} *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <{repo_url}|{repo}>"
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>"
mention_users: ${{ steps.extract_slack_id.outputs.suid }}
Expand Down

0 comments on commit 2062250

Please sign in to comment.