Skip to content

Commit

Permalink
chore: fix version pnpm for github action
Browse files Browse the repository at this point in the history
Signed-off-by: Nam Hoang <[email protected]>
  • Loading branch information
namhoang1604 committed Aug 12, 2023
1 parent 46b7fc2 commit c49af42
Show file tree
Hide file tree
Showing 3 changed files with 3,316 additions and 536 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
node-version: '18'

- name: Install pnpm
run: npm install -g [email protected]
run: npm install -g [email protected]

- name: pnpm version
run: pnpm --version

- name: Install dependencies
run: pnpm install
Expand All @@ -47,6 +50,12 @@ jobs:
- name: Build
run: pnpm build

- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: explorer
path: packages/demo-explorer/build/explorer

deploy_to_s3:
needs: install_and_build
runs-on: ubuntu-latest
Expand All @@ -58,6 +67,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: explorer
path: packages/demo-explorer/build/explorer

- name: Install AWS CLI
run: |
sudo apt-get -q install -y python3-pip
Expand All @@ -69,14 +84,8 @@ jobs:
role-to-assume: ${{ secrets.AWS_ROLE_GITHUB_ACTION_ARN }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy to S3
run: aws s3 sync packages/demo-explorer/build/explorer/ s3://${{ vars.AWS_S3_BUCKET_NAME }} --acl public-read --delete
run: aws s3 sync packages/demo-explorer/build/explorer/ s3://${{ vars.AWS_S3_BUCKET_NAME }} --delete

- name: Invalidate CloudFront
run: |
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"dev": "craco start",
"build": "pnpm run build:explorer && pnpm run build:verifier",
"build": "pnpm run build:explorer",
"build:explorer": "craco build",
"build:verifier": "REACT_APP_MODE=verifier craco build",
"test": "craco test --watchAll=false",
Expand Down
Loading

0 comments on commit c49af42

Please sign in to comment.