Skip to content

v1.22.11 (#958)

v1.22.11 (#958) #3141

Workflow file for this run

name: Test & build
on:
push:
branches:
- "*"
jobs:
test-and-build:
name: Test & build
runs-on: ubuntu-latest
permissions:
contents: read # This is required for actions/checkout
id-token: write # This is required for requesting the JWT
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn
- name: Install dependencies
run: yarn install --pure-lockfile
- name: Check licenses
run: yarn license-check
- name: GraphQL Codegen
run: yarn graphql-codegen
- name: Typecheck
run: yarn typecheck
- name: Lint
run: yarn lint
- name: Run tests
run: yarn test
- name: Compile project
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: yarn build
- name: Push onboarding translation keys
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref) }}
run: yarn localazy upload onboarding -r ${{ secrets.LOCALAZY_ONBOARDING_READ_KEY }} -w ${{ secrets.LOCALAZY_ONBOARDING_WRITE_KEY }}
- name: Push banking translation keys
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref)}}
run: yarn localazy upload banking -r ${{ secrets.LOCALAZY_BANKING_READ_KEY }} -w ${{ secrets.LOCALAZY_BANKING_WRITE_KEY }}
- name: Push payment translation keys
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref)}}
run: yarn localazy upload payment -r ${{ secrets.LOCALAZY_PAYMENT_READ_KEY }} -w ${{ secrets.LOCALAZY_PAYMENT_WRITE_KEY }}
- name: Configure AWS Credentials
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref) || contains(github.event.head_commit.message, '[dockerize]')}}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: eu-west-1
- name: Login to Docker Registry
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref) || contains(github.event.head_commit.message, '[dockerize]') }}
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
- name: Dockerize & Push to Registry
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref) || contains(github.event.head_commit.message, '[dockerize]') }}
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-swan
push: true
tags: |
${{ secrets.DOCKER_REGISTRY }}/swan-partner-frontend:master-${{ github.sha }}
${{ secrets.DOCKER_REGISTRY }}/swan-partner-frontend:master-${{ github.ref_name }}
- name: Deploy
if: ${{ github.repository == 'swan-io/swan-partner-frontend' && contains('refs/heads/main', github.ref) }}
run: yarn deploy-ci
env:
TAG: master-${{ github.sha }}
DEPLOY_SWAN_TOKEN: ${{ secrets.DEPLOY_SWAN_TOKEN }}
DEPLOY_SWAN_REPOSITORY: ${{ secrets.DEPLOY_SWAN_REPOSITORY }}
DEPLOY_GIT_USER: ${{ secrets.DEPLOY_GIT_USER }}
DEPLOY_GIT_EMAIL: ${{ secrets.DEPLOY_GIT_EMAIL }}
DEPLOY_ENVIRONMENT: master
DEPLOY_APP_NAME: partner-frontend