Skip to content

Commit

Permalink
chore: remove env and stagging
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Nov 25, 2024
1 parent cd2889a commit 934c382
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 67 deletions.
41 changes: 7 additions & 34 deletions .github/workflows/deploy-wallet-get-starknet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Deploy Wallet-UI and Get-starknet

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
type: environment
required: true
jobs:
prepare-deployment:
environment: ${{ inputs.environment }}
environment: production
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -27,40 +22,18 @@ jobs:
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
HASH=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d)
ENV=${{ inputs.environment }}
ENV=production
{
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 }}"
echo "VERSION=${BASE}"
echo "TAG=latest"
echo "ENV=prod"
echo "LOG_LEVEL=0"
} >> "$GITHUB_OUTPUT"
if [[ $ENV == "dev" ]]; then
{
echo "VERSION=${BASE}-dev-${HASH}-${DATE}"
echo "TAG=dev"
echo "ENV=dev"
echo "LOG_LEVEL=6"
} >> "$GITHUB_OUTPUT"
elif [[ $ENV == "staging" ]]; then
{
echo "VERSION=${BASE}-staging"
echo "TAG=staging"
echo "ENV=staging"
echo "LOG_LEVEL=0"
} >> "$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
outputs:
VERSION: ${{ steps.prepare_parameters.outputs.VERSION }}
TAG: ${{ steps.prepare_parameters.outputs.TAG }}
Expand Down Expand Up @@ -98,7 +71,7 @@ jobs:
echo "Building Get Starknet with GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH"
GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH yarn workspace @consensys/get-starknet build
SNAP_VERSION="${VERSION}$" GET_STARKNET_PUBLIC_PATH=$GET_STARKNET_PUBLIC_PATH yarn workspace @consensys/get-starknet build
env:
SNAP_ENV: ${{ needs.prepare-deployment.outputs.ENV }}
VERSION: ${{ needs.prepare-deployment.outputs.VERSION }}
Expand Down
41 changes: 8 additions & 33 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Publish NPM

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
type: environment
required: true
jobs:
prepare-deployment:
environment: ${{ inputs.environment }}
environment: production
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -27,33 +22,13 @@ jobs:
BASE=$(node -p "require('./packages/starknet-snap/package.json').version")
HASH=$(git rev-parse --short HEAD)
DATE=$(date +%Y%m%d)
ENV=${{ inputs.environment }}
if [[ $ENV == "dev" ]]; then
{
echo "VERSION=${BASE}-dev-${HASH}-${DATE}"
echo "TAG=dev"
echo "ENV=dev"
echo "LOG_LEVEL=6"
} >> "$GITHUB_OUTPUT"
elif [[ $ENV == "staging" ]]; then
{
echo "VERSION=${BASE}-staging"
echo "TAG=staging"
echo "ENV=staging"
echo "LOG_LEVEL=0"
} >> "$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
ENV=${{ inputs.environment }}
{
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 934c382

Please sign in to comment.