Skip to content

Commit

Permalink
chore: activate prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Nov 26, 2024
1 parent 120dfd6 commit d7ab7aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 52 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/deploy-wallet-get-starknet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ name: Deploy Wallet-UI and Get-starknet

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
type: environment
required: true

jobs:
prepare-deployment:
environment: dev
environment: production
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -26,30 +21,15 @@ jobs:
id: prepare_parameters
run: |
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
ENV=${{ inputs.environment }}
{
echo "VERSION=${BASE}"
echo "ENV=prod"
echo "AWS_CLOUDFRONT_DISTRIBUTIONS_ID=${{ vars.AWS_CLOUDFRONT_DISTRIBUTIONS_ID }}"
echo "AWS_S3_GET_STARKNET_URL=${{ vars.AWS_S3_GET_STARKNET_URL }}"
echo "AWS_S3_URL=${{ vars.AWS_S3_URL }}"
echo "GET_STARKNET_PUBLIC_PATH=${{ vars.GET_STARKNET_PUBLIC_PATH }}"
} >> "$GITHUB_OUTPUT"
if [[ $ENV == "dev" ]]; then
HASH=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d)
{
echo "VERSION=${BASE}-dev-${HASH}-${DATE}"
echo "ENV=dev"
} >> "$GITHUB_OUTPUT"
elif [[ $ENV == "production" ]]; then
{
echo "VERSION=${BASE}"
echo "ENV=prod"
} >> "$GITHUB_OUTPUT"
else
echo "Invalid environment"
exit 1
fi
outputs:
VERSION: ${{ steps.prepare_parameters.outputs.VERSION }}
TAG: ${{ steps.prepare_parameters.outputs.TAG }}
Expand Down
36 changes: 8 additions & 28 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ name: Publish NPM

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
type: environment
required: true

jobs:
prepare-deployment:
environment: dev
environment: production
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -26,29 +21,14 @@ jobs:
id: prepare_parameters
run: |
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
ENV=${{ inputs.environment }}
if [[ $ENV == "dev" ]]; then
HASH=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d)
{
echo "VERSION=${BASE}-dev-${HASH}-${DATE}"
echo "TAG=dev"
echo "ENV=dev"
echo "LOG_LEVEL=6"
} >> "$GITHUB_OUTPUT"
elif [[ $ENV == "production" ]]; then
{
echo "VERSION=${BASE}"
echo "TAG=latest"
echo "ENV=prod"
echo "LOG_LEVEL=0"
} >> "$GITHUB_OUTPUT"
else
echo "Invalid environment"
exit 1
fi
echo $GITHUB_OUTPUT
{
echo "VERSION=${BASE}"
echo "TAG=latest"
echo "ENV=prod"
echo "LOG_LEVEL=0"
} >> "$GITHUB_OUTPUT"
outputs:
VERSION: ${{ steps.prepare_parameters.outputs.VERSION }}
TAG: ${{ steps.prepare_parameters.outputs.TAG }}
Expand Down

0 comments on commit d7ab7aa

Please sign in to comment.