Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy wallet api to beta env #495

Open
dadiorchen opened this issue Dec 11, 2024 · 2 comments
Open

Deploy wallet api to beta env #495

dadiorchen opened this issue Dec 11, 2024 · 2 comments

Comments

@dadiorchen
Copy link
Collaborator

We need to find a way to deploy wallet API to another env, let's call it beta env, so we can easily pick a branch and deploy to that env.

@dadiorchen
Copy link
Collaborator Author

This is example from another project:

# The Github Action to build next.js and deploy to AWS S3
name: Development CI for SAAS client


on:
  push:
    branches:
      - main
      - beta*


env:
  AWS_S3_BUCKET: xxx
  AWS_CLOUDFRONT_DISTRIBUTION_ID: xxx
  AWS_REGION: us-west-2


jobs:
  # version the code with semantic versioning
  versioning:
    runs-on: ubuntu-latest
    outputs:
      tag_name: ${{ steps.package-version.outputs.current-version }}
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js 20.x
        uses: actions/setup-node@v1
        with:
          node-version: 20.x


      - run: npm i -g semantic-release @semantic-release/{git,exec,changelog}


      - run: semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


      - name: get-npm-version
        id: package-version
        uses: martinbeentjes/npm-get-version-action@master
        with:
          path: ./
      # print the version
      - name: print-version
        run: echo "The version is ${{ steps.package-version.outputs.current-version }}"


  build-and-deploy:
    runs-on: ubuntu-latest
    needs: versioning
    steps:
      - name: print-version
        run: echo "The version is ${{ needs.versioning.outputs.tag_name }}"
        id: print-version
      - uses: actions/checkout@v2
        with:
          # use the version from the previous step
          ref: v${{ needs.versioning.outputs.tag_name }}
      - name: Use Node.js 18.x
        uses: actions/setup-node@v1
        with:
          node-version: 18.x
      - name: Install dependencies
        run: yarn install
      - name: Build
        run: yarn build
        env:
      - name: Deploy to S3
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --follow-symlinks --delete
        env:
      - name: Invalidate Cloudfront Cache
        uses: chetan/invalidate-cloudfront-action@v2
        env:
          DISTRIBUTION: ${{ env.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
          PATHS: "/*"
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ env.AWS_REGION }}

@Mohmn
Copy link
Member

Mohmn commented Dec 11, 2024

im working on this , will complete it by this weekend but im depolying it to dev env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants