Update govuk_test
to v3.0.1
#367
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
RAILS_ENV: test | |
REDIS_URL: redis://localhost:6379/0 | |
steps: | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- uses: ankane/setup-opensearch@v1 | |
with: | |
opensearch-version: 1.3.10 | |
host port: 9200 | |
container port: 9200 | |
host node port: 9300 | |
node port: 9300 | |
discovery type: 'single-node' | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
- uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: bundle-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: bundle | |
- name: Check for cached node modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: yarn | |
- run: yarn install --frozen-lockfile | |
- uses: nanasess/setup-chromedriver@master | |
with: | |
# Optional: do not specify to match Chrome's version | |
chromedriver-version: '77.0.3865.40' | |
- run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
- run: bundle install --jobs 4 --retry 3 --deployment | |
- run: bundle exec rake | |
deploy_to_staging: | |
if: github.ref == 'refs/heads/main' | |
needs: test | |
environment: staging | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
- uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: bundle-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: bundle | |
- name: install cloud foundry | |
run: | | |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | |
echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | |
sudo apt-get update | |
sudo apt-get install cf-cli | |
- name: Deploy to staging | |
env: | |
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }} | |
CF_USER: ${{ secrets.CF_USER }} | |
CF_PASS: ${{ secrets.CF_PASS }} | |
CF_SPACE: ${{ secrets.CF_SPACE }} | |
CF_API: ${{ secrets.CF_API }} | |
run: scripts/deploy.sh find-data-beta-staging staging | |
deploy_to_production: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: test | |
environment: production | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
- uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: bundle-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: bundle | |
- name: install cloud foundry | |
run: | | |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | |
echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | |
sudo apt-get update | |
sudo apt-get install cf-cli | |
- name: Deploy to production | |
env: | |
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }} | |
CF_USER: ${{ secrets.CF_USER }} | |
CF_PASS: ${{ secrets.CF_PASS }} | |
CF_SPACE: ${{ secrets.CF_SPACE }} | |
CF_API: ${{ secrets.CF_API }} | |
run: scripts/deploy.sh find-data-beta production |