Skip to content

Commit a0f6981

Browse files
Setting up GitHub Actions workflow
1 parent 1296599 commit a0f6981

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

.github/workflows/go.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update code.json inventory file
2+
3+
on:
4+
schedule:
5+
# Run every 5 minutes for testing.
6+
- cron: "*/5 * * * *"
7+
8+
jobs:
9+
build:
10+
name: Build and Deploy
11+
runs-on: "ubuntu-latest"
12+
13+
env:
14+
#GHE_USERNAME:
15+
#GHE_PASSWORD:
16+
CF_USERNAME: ${{ secrets.CG_USERNAME}}
17+
CF_PASSWORD: ${{ secrets.CG_PASSWORD}}
18+
19+
20+
steps:
21+
- name: Check out code
22+
uses: actions/checkout@v2
23+
24+
- name: Make the cloudgov-deploy script executable
25+
run: chmod +x ./bin/deploy-cloudgov
26+
27+
- name: Deploy the app to cloud.gov
28+
run: ./bin/deploy-cloudgov

Staticfile

Whitespace-only changes.

bin/deploy-cloudgov

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CF_LOGIN="https://api.fr.cloud.gov"
6+
CF_ORG="sandbox-epa"
7+
CF_SPACE="ibarra.michelle"
8+
FRONTEND_NAME="code-json-cg"
9+
FRONTEND_MANIFEST="etc/manifests/frontend.yml"
10+
11+
# This directory is used to persist the Cloud Foundry credentials
12+
mkdir -p $HOME/.cf
13+
14+
# Container with Cloud Foundry client and blue-green-deploy, autopilot plug-ins
15+
docker pull governmentpaas/cf-cli:latest
16+
17+
# Execute all the CF commands via the container -- CircleCI provides docker
18+
# out-of-the-box, but not the CF command-line interface tools.
19+
cf_run() {
20+
docker run \
21+
--rm \
22+
-v $HOME/.cf:/root/.cf \
23+
-v $PWD:/app \
24+
-w /app \
25+
governmentpaas/cf-cli \
26+
cf "$@"
27+
}
28+
29+
# Sign in to the cloud.gov space that the app will be deployed to.
30+
#
31+
# CF_USERNAME and CF_PASSWORD are set in the GitHub Actions environment
32+
#
33+
# They should be populated with a space deployer service key credentials, as described at:
34+
# https://cloud.gov/docs/services/cloud-gov-service-account/
35+
cf_run login -a $CF_LOGIN -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
36+
37+
cf_run push $FRONTEND_NAME -f $FRONTEND_MANIFEST

etc/manifests/frontend.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
applications:
2+
- name: code-json-cg
3+
memory: 64M
4+
domain: app.cloud.gov
5+
buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git

0 commit comments

Comments
 (0)