Skip to content

Commit

Permalink
ci: fix node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
luislhl committed Jul 12, 2024
1 parent 08e9c5a commit 4888c77
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 42 deletions.
59 changes: 17 additions & 42 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,12 @@ jobs:
if: ${{ needs.init.outputs.environment == 'dev' }}

steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
- name: Step name
uses: aws-actions/aws-secretsmanager-get-secrets@v2
- name: Prepare deploy
uses: ./.github/workflows/lib/prepare-deploy
with:
secret-ids: |
arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/dev-0ikehC
parse-json-secrets: true
- name: Check env
run: |
env
- name: Set up Python and Dependencies
uses: ./.github/workflows/lib/setup-python
with:
python_version: 3.9
aws_region: eu-central-1
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/dev-0ikehC
- name: Deploy Lambdas Dev
run: |
make deploy-lambdas-ci stage=dev
Expand Down Expand Up @@ -149,18 +134,13 @@ jobs:
if: ${{ needs.init.outputs.environment == 'testnet' }}

steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
- name: Set up Python and Dependencies
uses: ./.github/workflows/lib/setup-python
- name: Prepare deploy
uses: ./.github/workflows/lib/prepare-deploy
with:
python_version: 3.9
aws_region: eu-central-1
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
# TODO
# aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/dev-0ikehC
- name: Deploy Lambdas Testnet
run: |
make deploy-lambdas-ci stage=testnet
Expand Down Expand Up @@ -195,18 +175,13 @@ jobs:
if: ${{ needs.init.outputs.environment == 'mainnet' }}

steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
- name: Set up Python and Dependencies
uses: ./.github/workflows/lib/setup-python
- name: Prepare deploy
uses: ./.github/workflows/lib/prepare-deploy
with:
python_version: 3.9
aws_region: eu-central-1
aws_iam_role: arn:aws:iam::769498303037:role/ExplorerServiceGitHubActionsRole
# TODO
# aws_secret_arn: arn:aws:secretsmanager:eu-central-1:769498303037:secret:ExplorerService/dev-0ikehC
- name: Deploy Lambdas Mainnet
run: |
make deploy-lambdas-ci stage=mainnet
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/lib/prepare-deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Prepare environment for deploy"
description: "Prepare environment for deploy"

inputs:
aws_region:
description: "AWS Region"
required: true
aws_iam_role:
description: "AWS IAM Role to assume for deployment"
required: true
aws_secret_arn:
description: "AWS Secret ARN to fetch env vars from"
required: true

runs:
using: "composite"
steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: ${{ inputs.aws_region }}
role-to-assume: ${{ inputs.aws_iam_role }}
- name: Step name
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
${{ inputs.aws_secret_arn }}
parse-json-secrets: true
- name: Check env
run: |
env
# This step recovers the artifact that is generated in the `deploy.yml` workflow
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: node_modules
- name: Set up Python and Dependencies
uses: ./.github/workflows/lib/setup-python
with:
python_version: 3.9

0 comments on commit 4888c77

Please sign in to comment.