This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
modify dockerfile to use phusion passenger image #3
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
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
name: Build, test and deploy (on master only) | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:11 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: funding_frontend_test | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: 'Install Postgres client' | |
run: sudo apt-get -yqq install libpq-dev | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '16.14.2' | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- run: yarn install | |
- run: gem install bundler -v 2.3.11 | |
- name: Cache Gemfile dependencies | |
uses: actions/cache@v1 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems | |
- name: Bundle install | |
run: | | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: Run RSpec automated test suite | |
env: | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
RAILS_ENV: test | |
run: | | |
bin/rails db:setup | |
bundle exec rspec | |
- name: Run Jest automated test suite | |
run: | | |
yarn jest | |
- name: Install the CF CLI | |
if: github.ref == 'refs/heads/master' | |
run: | | |
wget https://s3-us-west-1.amazonaws.com/v7-cf-cli-releases/releases/v7.2.0/cf7-cli-installer_7.2.0_x86-64.deb | |
sudo dpkg -i cf7-cli-installer_7.2.0_x86-64.deb | |
- name: Authenticate with CloudFoundry | |
if: github.ref == 'refs/heads/master' | |
env: | |
CF_USERNAME: ${{ secrets.CF_USERNAME }} | |
CF_PASSWORD: ${{ secrets.CF_PASSWORD }} | |
run: | | |
cf api https://api.london.cloud.service.gov.uk | |
cf auth | |
cf target -o national-lottery-heritage-fund | |
- name: Deploy to staging | |
if: github.ref == 'refs/heads/master' | |
env: | |
CF_APP: funding-frontend-staging | |
CF_SPACE: sandbox | |
CF_MANIFEST: staging | |
run: | | |
cf target -s ${CF_SPACE} | |
cf push ${CF_APP} -f manifest-${CF_MANIFEST}.yml --strategy rolling | |
- name: Deploy to UAT | |
if: github.ref == 'refs/heads/master' | |
env: | |
CF_APP: funding-frontend-uat | |
CF_SPACE: uat | |
CF_MANIFEST: uat | |
run: | | |
cf target -s ${CF_SPACE} | |
cf push ${CF_APP} -f manifest-${CF_MANIFEST}.yml --strategy rolling |