Skip to content

Commit

Permalink
Merge pull request #136 from guardian/lp-migrate-super-mode-calculato…
Browse files Browse the repository at this point in the history
…r-to-githubActions

Migrate super-mode-calculator from Teamcity to GitHub Actions
  • Loading branch information
LAKSHMIRPILLAI authored Aug 16, 2023
2 parents 93fe1cf + 28ce69a commit 6b22e75
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 418 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/super-mode-calculator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Upload super-mode-calculator to riff raff
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
super_mode_calculator_build:
if: github.repository_owner == 'guardian'
# Required by actions-riff-raff
permissions:
id-token: write
contents: read

name: Build super-mode-calculator
runs-on: ubuntu-latest

steps:
- name: Env
run: env

- name: Checkout repo
uses: actions/checkout@v3

- name: Configure AWS credentials # needed by actions-riff-raff
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
aws-region: eu-west-1

- name: Setup Node
uses: actions/setup-node@v3
with:
cache: 'yarn'
cache-dependency-path: ./super-mode-calculator/yarn.lock
node-version-file: super-mode-calculator/.nvmrc

- name: Yarn
run: |
yarn install
yarn lint
yarn run build
working-directory: ./super-mode-calculator

- name: Copy files to Riff Raff package
run: cp package.json riff-raff.yaml target
working-directory: ./super-mode-calculator

- name: Yarn install in package
run: yarn install --production
working-directory: ./super-mode-calculator/target

- name: Zip target directory contents (quietly)
run: zip -qr super-mode-calculator.zip ./*
working-directory: ./super-mode-calculator/target

- uses: guardian/actions-riff-raff@v2
with:
projectName: Support::super-mode-calculator
configPath: ./super-mode-calculator/riff-raff.yaml
buildNumberOffset: 250
contentDirectories: |
super-mode-calculator:
- ./super-mode-calculator/target/super-mode-calculator.zip
super-mode-calculator-cloudformation:
- ./super-mode-calculator/cfn.yaml
4 changes: 1 addition & 3 deletions super-mode-calculator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"scripts": {
"lint": "eslint '*/**/*.ts'",
"build": "tsc",
"local": "Stage=CODE AthenaOutputBucket=gu-support-analytics SchemaName=acquisition AWS_PROFILE=membership ts-node src/local/run.ts",
"package": "ARTEFACT_PATH=$PWD/target VERBOSE=true riffraff-artefact"
"local": "Stage=CODE AthenaOutputBucket=gu-support-analytics SchemaName=acquisition AWS_PROFILE=membership ts-node src/local/run.ts"
},
"devDependencies": {
"@guardian/eslint-config-typescript": "^0.7.0",
Expand All @@ -24,7 +23,6 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.2.1",
"node-riffraff-artefact": "^2.0.1",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
Expand Down
4 changes: 2 additions & 2 deletions super-mode-calculator/riff-raff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ deployments:
type: aws-lambda
parameters:
prefixStack: false
bucket: membership-dist
bucketSsmLookup: true
fileName: super-mode-calculator.zip
functionNames:
- super-mode-calculator-partition-lambda-
Expand All @@ -17,4 +17,4 @@ deployments:
type: cloud-formation
app: super-mode-calculator
parameters:
templatePath: cloudformation/cfn.yaml
templatePath: cfn.yaml
27 changes: 0 additions & 27 deletions super-mode-calculator/teamcity.sh

This file was deleted.

Loading

0 comments on commit 6b22e75

Please sign in to comment.