-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from HHS/tech-debt-refactor-actions-001
tech-debt: Refactor GitHub Actions
- Loading branch information
Showing
10 changed files
with
164 additions
and
72 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Deploy Backend | ||
description: Deploy backend code to Cloud.gov environment. | ||
inputs: | ||
USERNAME: | ||
description: Cloud.gov user to authenticate with. | ||
required: true | ||
PASSWORD: | ||
description: Cloud.gov authentication password. | ||
required: true | ||
ORG_NAME: | ||
description: Cloud.gov Organization Name. | ||
required: true # Default to our Org once setup. | ||
SPACE_NAME: | ||
description: Cloud.gov Space (environment) Name. | ||
required: true | ||
APP_NAME: | ||
description: Applicaiton name (from manifest.yml). | ||
required: true | ||
outputs: | ||
BACKEND_DOMAIN: | ||
description: Uri of the deployed backend. | ||
value: ${{ steps.deploy-backend.outputs.BACKEND_DOMAIN }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Deploy to Cloud.gov | ||
run: | | ||
export PATH=$HOME/bin:$PATH | ||
cf login -a https://api.fr.cloud.gov -u ${{ inputs.USERNAME }} -p ${{ inputs.PASSWORD }} -o ${{ inputs.ORG_NAME }} -s ${{ inputs.SPACE_NAME }} | ||
cf push ${{ inputs.APP_NAME }} -f manifest.yml | ||
BACKEND_GUID=$(cf app ${{ inputs.APP_NAME }} --guid) | ||
BACKEND_DOMAIN=$(cf curl /v3/apps/$BACKEND_GUID/env | jq -r .application_env_json.VCAP_APPLICATION.application_uris[0]) | ||
echo "::set-output name=BACKEND_DOMAIN::${BACKEND_DOMAIN}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Deploy Frontend | ||
description: Deploy frontend code to Cloud.gov environment. | ||
inputs: | ||
USERNAME: | ||
description: Cloud.gov user to authenticate with. | ||
required: true | ||
PASSWORD: | ||
description: Cloud.gov authentication password. | ||
required: true | ||
ORG_NAME: | ||
description: Cloud.gov Organization Name. | ||
required: true # Default to our Org once setup. | ||
SPACE_NAME: | ||
description: Cloud.gov Space (environment) Name. | ||
required: true | ||
APP_NAME: | ||
description: Applicaiton name (from manifest.yml). | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Deploy to Cloud.gov | ||
id: deploy-frontend | ||
run: | | ||
export PATH=$HOME/bin:$PATH | ||
cf login -a https://api.fr.cloud.gov -u ${{ inputs.USERNAME }} -p ${{ inputs.PASSWORD }} -o ${{ inputs.ORG_NAME }} -s ${{ inputs.SPACE_NAME }} | ||
cf push ${{ inputs.APP_NAME }} -f manifest.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Run Full Stack | ||
description: Runs the full stack from the docker-compose.yml | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Start Stack | ||
shell: bash | ||
run: docker-compose up --build -d |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Setup Cloud Foundry | ||
description: Download the cloud foundary binary | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install CF | ||
run: | | ||
mkdir -p $HOME/bin | ||
export PATH=$HOME/bin:$PATH | ||
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary" | tar xzv -C $HOME/bin |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Set up Javascript | ||
description: Installs Node.js and dependencies defined in package.json | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
cache-dependency-path: '**/yarn.lock' | ||
- name: Install yarn dependencies | ||
shell: bash | ||
working-directory: ./frontend | ||
run: yarn install --frozen-lockfile |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Set up Python | ||
description: Installs Python3 and dependencies defined in the Pipfile | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
cache: pipenv | ||
- name: Install Pipenv | ||
shell: bash | ||
run: pip install pipenv | ||
- name: Install Pipenv dependencies | ||
shell: bash | ||
working-directory: ./backend | ||
run: pipenv install --dev |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Nightly Security Analysis | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# cron format: 'minute hour dayofmonth month dayofweek' | ||
# this will run at 8AM UTC every day (3am EST / 4am EDT) | ||
- cron: '0 8 * * *' | ||
|
||
jobs: | ||
dast-scan: | ||
name: OWASP Zap Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- id: setup | ||
uses: ./.github/actions/run-full-stack | ||
|
||
- name: Run OWASP Zap Scan | ||
uses: zaproxy/[email protected] | ||
with: | ||
docker_name: 'owasp/zap2docker-stable' | ||
target: 'http://localhost:3000/' | ||
fail_action: true | ||
cmd_options: '-I' |
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