Skip to content

Commit

Permalink
Deploy site using GH actions. (#131)
Browse files Browse the repository at this point in the history
The DEPLOY workflow is now used to deploy the site to cloud foundry directly.
  • Loading branch information
pderop authored Jan 15, 2024
1 parent 7617e69 commit d8430bf
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: DEPLOY
on:
workflow_dispatch:
permissions:
teams:
- 'reactor/team'
inputs:
application:
description: 'Application name to deploy:'
required: true
type: choice
default: 'projectreactor-test'
options:
- 'projectreactor-test'
- 'projectreactor'

permissions: read-all

jobs:
deploy-cf:
runs-on: reactor-self-hosted
env:
APPNAME: ${{ github.event.inputs.application }}
ROUTE: ${{ github.event.inputs.application == 'projectreactor' && 'https://projectreactor.io' || 'https://projectreactor-test.wdc-08-pcf1-pws-apps.oc.vmware.com' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0 #for spotless ratchet
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'temurin'
java-version: 8
- uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2
name: build
with:
arguments: build
- name: Deploy to CF primary
if: inputs.application == 'projectreactor'
uses: citizen-of-planet-earth/cf-cli-action@v2
with:
cf_api: $${{ secrets.CF_PRIMARY_API }}
cf_username: ${{ secrets.CF_USER }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: ${{ secrets.CF_ORG }}
cf_space: ${{ secrets.CF_SPACE }}
command: push -f manifest.yml --var appname=${{ env.APPNAME }} --var route=${{ env.ROUTE }}
- name: Deploy to CF secondary
uses: citizen-of-planet-earth/cf-cli-action@v2
with:
cf_api: $${{ secrets.CF_SECONDARY_API }}
cf_username: ${{ secrets.CF_USER }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: ${{ secrets.CF_ORG }}
cf_space: ${{ secrets.CF_SPACE }}
command: push -f manifest.yml --var appname=${{ env.APPNAME }} --var route=${{ env.ROUTE }}
5 changes: 2 additions & 3 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
applications:
- name: projectreactor
- name: ((appname))
memory: 1G
path: ./build/libs/projectreactor-home.jar
buildpacks:
- java_buildpack_offline
routes:
- route: https://projectreactor.io
- route: https://projectreactor.sc2-04-pcf1-apps.oc.vmware.com
- route: ((route))
disk_quota: 1024M
env:
JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 11.+ } }'

0 comments on commit d8430bf

Please sign in to comment.