Production IPFS Deployment #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Production IPFS Deployment | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
environment: production-ipfs | |
strategy: | |
matrix: | |
node-version: [20.15.0] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure AWS CLI | |
run: | | |
aws configure set aws_access_key_id "${{ secrets.FILEBASE_ACCESS_KEY }}" | |
aws configure set aws_secret_access_key "${{ secrets.FILEBASE_SECRET_KEY }}" | |
aws configure set default.region us-east-1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Create env file | |
run: | | |
echo VITE_COIN_GECKO_API_URL=${{ secrets.VITE_COIN_GECKO_API_URL }} > .env.production | |
echo VITE_TRM_LABS_API_URL=${{ secrets.VITE_TRM_LABS_API_URL }} >> .env.production | |
echo VITE_BASE_WALLET_PROJECT_ID=${{ secrets.VITE_BASE_WALLET_PROJECT_ID }} >> .env.production | |
echo VITE_LIFI_INTEGRATOR=${{ secrets.VITE_LIFI_INTEGRATOR }} >> .env.production | |
echo VITE_BASE_RPC_FREE_1=${{ secrets.VITE_BASE_RPC_FREE_1 }} >> .env.production | |
echo VITE_BASE_MAIN_RPC_URL=${{ secrets.VITE_BASE_MAIN_RPC_URL }} >> .env.production | |
echo VITE_BASE_RPC_PAID_WS_2=${{ secrets.VITE_BASE_RPC_PAID_WS_2 }} >> .env.production | |
echo VITE_SENTRY_AUTH_TOKEN=${{ secrets.VITE_SENTRY_AUTH_TOKEN }} >> .env.production | |
echo VITE_STYLE_VERSION=${{ secrets.VITE_STYLE_VERSION }} >> .env.production | |
echo VITE_USE_TENDERLY_SIMULATION=${{ secrets.VITE_USE_TENDERLY_SIMULATION }} >> .env.production | |
echo VITE_TESTMODE=${{ secrets.VITE_TESTMODE }} >> .env.production | |
echo VITE_ALCHEMY_SIMULATION_RPC_URL=${{ secrets.VITE_ALCHEMY_SIMULATION_RPC_URL }} >> .env.production | |
echo VITE_EXTENSIVE_OPERATIONS_RPC_URL=${{ secrets.VITE_EXTENSIVE_OPERATIONS_RPC_URL }} >> .env.production | |
echo VITE_DUNE_CACHE_API=${{ secrets.VITE_DUNE_CACHE_API }} >> .env.production | |
- run: npm ci | |
- run: npm run build --if-present | |
- name: Rename dist folder | |
run: | | |
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S) | |
mv dist "${TIMESTAMP}_${GITHUB_SHA}" | |
echo "APP_BUILD_NAME=${TIMESTAMP}_${GITHUB_SHA}" >> "$GITHUB_ENV" | |
- name: Create IPFS .car | |
run: | | |
npm i -g [email protected] | |
ipfs-car pack ${APP_BUILD_NAME} --output ${APP_BUILD_NAME}.car | |
ipfs-car ls ${APP_BUILD_NAME}.car | |
- name: Upload to IPFS | |
env: | |
FILEBASE_ACCESS_KEY: "${{ secrets.FILEBASE_ACCESS_KEY }}" | |
FILEBASE_SECRET_KEY: "${{ secrets.FILEBASE_SECRET_KEY }}" | |
run: | | |
aws --endpoint https://s3.filebase.com/ s3 cp ${APP_BUILD_NAME}.car s3://seamless-interface/prod/${APP_BUILD_NAME} --debug --metadata 'import=car' |