Skip to content

Staging deployment

Staging deployment #21

name: 'Staging deployment'
on: [workflow_dispatch]
jobs:
deploy_staging:
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-20.04
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: Read Ruby version
id: ruby-version
run: echo "ruby-version=$(cat .ruby-version)" >> $GITHUB_ENV
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby-version }}
- uses: actions/setup-node@v2-beta
with:
node-version: '16'
- 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: |
(apt update && apt install --yes curl gnupg) > /dev/null 2>&1
curl -fsSL https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | gpg --dearmor -o /usr/share/keyrings/cloudfoundry-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-keyring.gpg] https://packages.cloudfoundry.org/debian stable main" | tee /etc/apt/sources.list.d/cloudfoundry.list
apt update > /dev/null 2>&1
apt install --yes cf8-cli
cf8 version
cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
cf install-plugin blue-green-deploy -r CF-Community -f
./bin/deploy