Skip to content

Commit

Permalink
Merge pull request #3150 from bitzesty/main
Browse files Browse the repository at this point in the history
Staging < main
  • Loading branch information
TheDancingClown authored Dec 4, 2024
2 parents e9461af + 54c104c commit 1136676
Show file tree
Hide file tree
Showing 112 changed files with 2,601 additions and 2,023 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ GOV_UK_NOTIFY_API_KEY=key
GOV_UK_NOTIFY_API_TEMPLATE_ID=id
SESSION_TIMEOUT=1
HOST=http://localhost:3000
ENABLE_ASIM_LOGGER=false
92 changes: 6 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
services:
db:
image: postgres:12-alpine
image: postgres:16-alpine
ports: ['5432:5432']
env:
POSTGRES_DB: qae_test
Expand Down Expand Up @@ -58,8 +58,11 @@ jobs:
BUNDLER_VERSION: 2.5.6
DOCKER_TLS_CERTDIR: ''
run: |
sudo apt update
sudo apt-get -yqq install postgresql postgresql-client libpq-dev xvfb unzip libcurl4 libcurl3-gnutls libcurl4-openssl-dev
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-client-16
sudo apt-get -yqq install libpq-dev xvfb unzip libcurl4 libcurl3-gnutls libcurl4-openssl-dev
gem install bundler
gem update --system && gem update bundler
yarn install
Expand All @@ -78,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
17 changes: 11 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |name| "https://github.com/#{name}.git" }

ruby "~> 3.2.4"

gem "rails", "7.0.8.1"
gem "rails", "7.0.8.4"
gem "websocket-extensions", "~> 0.1.5"

# SSL redirect
Expand Down Expand Up @@ -52,6 +52,9 @@ gem "json"
gem "jbuilder", "~> 2.10.1"
gem "gon", ">= 6.4.0"

# XML builder
gem "builder"

# XLSX generation
gem "rubyXL", "~> 3.4"

Expand Down Expand Up @@ -79,6 +82,7 @@ gem "simple_form", "~> 5.0"
gem "country_select", "~> 3.1"
gem "email_validator"
gem "enumerize"
gem "phonelib"

# PDF generation
gem "prawn"
Expand Down Expand Up @@ -120,12 +124,16 @@ gem "virtus"
gem "nilify_blanks"

# Web server
gem "puma", "~> 6.4.2"
gem "puma", "~> 6.4.3"

# Performance & Error reporting
gem "appsignal"
gem "stackprof"
gem "sentry-ruby"
gem "sentry-rails"
gem "sentry-sidekiq"

# Log formatting
gem "json_tagged_logger"
gem "lograge"

# speedup server boot time
Expand All @@ -134,9 +142,6 @@ gem "bootscale", require: false
# IE 8 and lower detection
gem "browser", "6.0.0"

# Healthchecks
gem "rails-healthcheck"

# An implementation of Matrix and Vector classes.
gem "matrix"

Expand Down
Loading

0 comments on commit 1136676

Please sign in to comment.