enable egress proxy #148
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: enable egress proxy | |
on: # yamllint disable-line rule:truthy | |
workflow_dispatch: | |
inputs: | |
appName: | |
description: 'App Name' | |
required: true | |
type: choice | |
options: | |
- "catalog-web" | |
- "catalog-admin" | |
- "catalog-fetch" | |
- "catalog-gather" | |
- dashboard | |
- "dashboard-stage" | |
- inventory | |
appSpace: | |
description: 'Cloud Foundry Space' | |
required: true | |
type: choice | |
options: | |
- development | |
- staging | |
- prod | |
env: | |
DATAGOV_DIR: datagov | |
CG_DIR: cg-egress-proxy | |
jobs: | |
enable-egress: | |
concurrency: ${{ github.event.inputs.appSpace }} | |
name: ${{ github.event.inputs.appName }} -- ${{ github.event.inputs.appSpace }} # yamllint disable-line rule:line-length | |
environment: ${{ github.event.inputs.appSpace }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout datagov | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.DATAGOV_DIR }} | |
- name: checkout cg-egress-proxy | |
uses: actions/checkout@v3 | |
with: | |
repository: 'GSA-TTS/cg-egress-proxy' | |
ref: "4d4aacf85cea46699571df93df46919e489128be" | |
path: ${{ env.CG_DIR }} | |
# trying to emulate: | |
# https://github.com/GSA/cg-egress-proxy/blob/main/Dockerfile | |
- name: build caddy - setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
- name: build caddy - get xcaddy | |
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest | |
- name: build caddy - xcaddy build | |
run: > | |
xcaddy build | |
--with github.com/caddyserver/forwardproxy@caddy2 | |
--output ${{ env.CG_DIR }}/proxy/caddy | |
- name: enable egress | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
# tmate command for testing and debugging | |
# command: apt-get -y install tmate; tmate -F | |
command: > | |
${{ env.DATAGOV_DIR }}/bin/enable-egress | |
${{ github.event.inputs.appName }} | |
${{ github.event.inputs.appSpace }} | |
cf_org: gsa-datagov | |
cf_space: ${{ github.event.inputs.appSpace }} | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} |