Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 0 additions & 188 deletions .circleci/config.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test, Build and Deploy

on:
push:
branches:
- qa
- staging
- master
pull_request:
branches:
- qa
- staging


jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn e2e:prod
- run: yarn test

qa:
needs: test
if: github.ref == 'refs/heads/qa'
uses: ./.github/workflows/deploy.yml
with:
bucket: forms.qa.codeyourfuture.io
distribution: E2VFUDC8YCDBKS
environment: qa
node_env: QA
region: eu-west-1
role: arn:aws:iam::732238248492:role/cyf-bot-qa-ci-role
url: https://forms.qa.codeyourfuture.io


staging:
needs: test
if: github.ref == 'refs/heads/staging'
uses: ./.github/workflows/deploy.yml
with:
bucket: forms.staging.codeyourfuture.io
distribution: E1SJFMKKCNFUGI
environment: staging
node_env: STAGING
region: eu-west-1
role: arn:aws:iam::732238248492:role/cyf-bot-staging-ci-role
url: https://forms.staging.codeyourfuture.io


production:
needs: test
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/deploy.yml
with:
bucket: forms.codeyourfuture.io
distribution: E3MHHTOV68A76Q
environment: production
node_env: PRODUCTION
region: eu-west-1
role: arn:aws:iam::732238248492:role/cyf-bot-production-ci-role
url: https://forms.codeyourfuture.io

66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
workflow_call:
inputs:
bucket:
description: the name of the S3 bucket
required: true
type: string
distribution:
description: the id of the Cloudfront distribution
required: true
type: string
environment:
description: the name of the environment containing relevant secrets/variables
required: true
type: string
node_env:
description: the name of the environment for building
required: true
type: string
region:
description: AWS region for s3, cloudfront (defaults to 'eu-west-1')
default: 'eu-west-1'
required: false
type: string
role:
description: ARN of the AWS IAM role to assume via OIDC
required: true
type: string
url:
description: the public URL of the deployment (optional)
required: false
type: string



jobs:
build-and-deploy:
runs-on: ubuntu-slim
permissions:
id-token: write
contents: read
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.url }}
steps:
- uses: actions/checkout@v6
- run: npm install --global yarn
- uses: actions/setup-node@v6
with:
node-version: 22
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build
env:
BUILD_PATH: ${{ inputs.environment }}
GENERATE_SOURCEMAP: 'false'
VITE_NODE_ENV: ${{ inputs.node_env }}
- uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ inputs.role }}
aws-region: ${{ inputs.region }}
- uses: CodeYourFuture/internal-actions/.github/actions/deploy-webpage@main
with:
bucket: ${{ inputs.bucket }}
build-folder: ./build/${{ inputs.environment }}
distribution: ${{ inputs.distribution }}