|
| 1 | +--- |
| 2 | +name: enable egress proxy |
| 3 | + |
| 4 | +on: # yamllint disable-line rule:truthy |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + appName: |
| 8 | + description: 'App Name' |
| 9 | + required: true |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - "ssb-eks" |
| 13 | + - "ssb-smtp" |
| 14 | + - "ssb-solrcloud" |
| 15 | + appSpace: |
| 16 | + description: 'Cloud Foundry Space' |
| 17 | + required: true |
| 18 | + type: choice |
| 19 | + options: |
| 20 | + - "development-ssb" |
| 21 | + - "management-staging" |
| 22 | + - "management" |
| 23 | + |
| 24 | +env: |
| 25 | + SSB_DIR: ssb |
| 26 | + CG_DIR: cg-egress-proxy |
| 27 | + |
| 28 | +jobs: |
| 29 | + enable-egress: |
| 30 | + concurrency: ${{ github.event.inputs.appSpace }} |
| 31 | + name: ${{ github.event.inputs.appName }} -- ${{ github.event.inputs.appSpace }} |
| 32 | + environment: ${{ github.event.inputs.appSpace }} |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: checkout ssb |
| 36 | + uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + path: ${{ env.SSB_DIR }} |
| 39 | + - name: checkout cg-egress-proxy |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + repository: 'GSA/cg-egress-proxy' |
| 43 | + path: ${{ env.CG_DIR }} |
| 44 | + |
| 45 | + # trying to emulate: |
| 46 | + # https://github.com/GSA/cg-egress-proxy/blob/main/Dockerfile |
| 47 | + - name: build caddy - setup go |
| 48 | + uses: actions/setup-go@v3 |
| 49 | + with: |
| 50 | + go-version: '1.18.4' # latest |
| 51 | + - name: build caddy - get xcaddy |
| 52 | + run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest |
| 53 | + - name: build caddy - xcaddy build |
| 54 | + run: > |
| 55 | + xcaddy build |
| 56 | + --with github.com/hairyhenderson/caddy-teapot-module@v0.0.3-0 |
| 57 | + --with github.com/caddyserver/forwardproxy@caddy2 |
| 58 | + --output ${{ env.CG_DIR }}/proxy/caddy |
| 59 | +
|
| 60 | + - name: enable egress |
| 61 | + uses: cloud-gov/cg-cli-tools@main |
| 62 | + with: |
| 63 | + # tmate command for testing and debugging |
| 64 | + # command: apt-get -y install tmate; tmate -F |
| 65 | + command: > |
| 66 | + ssb/egress/enable-egress |
| 67 | + ${{ github.event.inputs.appName }} |
| 68 | + ${{ github.event.inputs.appSpace }} |
| 69 | + cf_org: gsa-datagov |
| 70 | + cf_space: ${{ github.event.inputs.appSpace }} |
| 71 | + cf_username: ${{secrets.CF_SERVICE_USER}} |
| 72 | + cf_password: ${{secrets.CF_SERVICE_AUTH}} |
0 commit comments