Skip to content

Tidy up write ui config file (#54) #49

Tidy up write ui config file (#54)

Tidy up write ui config file (#54) #49

name: Environment Main - Apply
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
envtest:
name: Environment Main - Apply
runs-on: ubuntu-latest
environment: primary-rw
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install esbuild
run: npm install -g esbuild
- name: Compile, check and test graphql
run: IN_PIPELINE=true make graphql
- name: Test ui
run: IN_PIPELINE=true make ui-test
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@a38818475bb21847788496e9f0fddaa4e84955ba
with:
project-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: graphql/coverage/lcov.info
- name: Configure AWS Access
uses: aws-actions/configure-aws-credentials@ead1e6af28a20f26cc47437fa7e4c8357409ef24
with:
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT }}:role/${{ vars.AWS_ROLE }}
role-session-name: GitHubDeploy-${{ vars.ENVIRONMENT }}
aws-region: ${{ vars.AWS_REGION }}
- name: terraform apply
uses: dflook/terraform-apply@7d435d4d115a11e5db1e710ac969f5382f0f6f9f
id: terraform
with:
path: terraform/environment/wildsea
variables: |
environment="${{ vars.ENVIRONMENT }}"
saml_metadata_url="${{ secrets.SAML_METADATA_URL }}"
backend_config:
bucket=${{ vars.STATE_BUCKET }}
key=${{ vars.ENVIRONMENT }}/terraform.tfstate
region=${{ vars.AWS_REGION }}
- name: write UI config file
run: |
echo "${{ toJSON(steps.terraform.outputs) }}" | jq 'with_entries(.value = {value: .value})' > ui/config/output-${{ vars.ENVIRONMENT }}.json}}
- name: Push UI
run: |
IN_PIPELINE=true make ui/.push-${{ vars.ENVIRONMENT }}