Merge pull request #275 from guardian/correct-s+-rateplanIds #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build memsub-promotions-lambdas | |
on: | |
pull_request: | |
branches: | |
- "**" | |
push: | |
branches: | |
- main | |
jobs: | |
memsub-promotions-lambdas: | |
if: >- | |
(github.actor != 'dependabot[bot]') && | |
(github.event.pull_request.head.repo.owner.login == 'guardian' || | |
github.event_name == 'push') | |
# Required by actions-assume-aws-role | |
permissions: | |
id-token: write | |
contents: read | |
name: memsub-promotions-lambdas | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: './lambdas/.nvmrc' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | |
aws-region: eu-west-1 | |
- name: Test + build | |
working-directory: ./lambdas | |
run: | | |
npm install -g yarn | |
yarn install | |
yarn compile | |
cp package.json dist | |
pushd dist | |
yarn dist | |
zip -r MembershipSub-Promotions-PromoCode-View ./* | |
popd | |
- name: riff-raff | |
uses: guardian/actions-riff-raff@v2 | |
with: | |
app: memsub-promotions-lambdas | |
buildNumberOffset: 500 | |
config: | | |
stacks: | |
- membership | |
regions: | |
- eu-west-1 | |
allowedStages: | |
- PROD | |
deployments: | |
memsub-promotions-lambdas-cloudformation: | |
type: cloud-formation | |
app: MembershipSub-Promotions-PromoCode-View | |
parameters: | |
cloudFormationStackName: memsub-promotions-lambdas | |
templateStagePaths: | |
PROD: memsub-promotions-lambdas-cf.yaml | |
cloudFormationStackByTags: false | |
prependStackToCloudFormationStackName: false | |
appendStageToCloudFormationStackName: false | |
MembershipSub-Promotions-PromoCode-View: | |
type: aws-lambda | |
parameters: | |
prefixStack: false | |
fileName: MembershipSub-Promotions-PromoCode-View.zip | |
bucket: gu-promotions-tool-dist | |
functionNames: | |
- MembershipSub-Promotions-to-PromoCode-View- | |
- MembershipSub-PromoCode-View-Dynamo-to-Salesforce- | |
dependencies: | |
- memsub-promotions-lambdas-cloudformation | |
contentDirectories: | | |
MembershipSub-Promotions-PromoCode-View: | |
- lambdas/dist/MembershipSub-Promotions-PromoCode-View.zip | |
memsub-promotions-lambdas-cloudformation: | |
- cloudformation/memsub-promotions-lambdas-cf.yaml |