From 1966fea3f84e21c7795118f72dcb3bf72661b355 Mon Sep 17 00:00:00 2001 From: Allan <31974198+BrewDogDev@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:11:15 -0400 Subject: [PATCH] deployment fix --- .github/workflows/deploy.yml | 60 +++++++++++++++++------------------- package.json | 8 ++--- 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bd07756..09eec31 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,6 @@ -name: Deploy To Arweave & ARNS +name: Arweave Deploy -# Deploy to arweave +# Trigger deployment only when pushing to the master branch on: push: branches: @@ -9,45 +9,41 @@ on: jobs: Arweave-build-and-deploy: runs-on: ubuntu-latest + env: + VITE_GA4_MEASUREMENT_ID: ${{ vars.GA4_MEASUREMENT_ID }} steps: - # Check out the repository code - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - # Set up Node.js environment - - name: Setup Node.js environment - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v3 with: node-version: "22" - # Verify that required secrets are present - # DEPLOY_KEY: Your Arweave wallet key (required) - # DEPLOY_ANT_PROCESS_ID: Your ArNS name's ANT process ID (required) - # DEPLOY_UNDERNAME: Optional undername to deploy to - - name: Check required secrets + # Verify that required secret and variables are present + # DEPLOY_KEY: Your Arweave wallet key (required secret) + # DEPLOY_ARNS_NAME: Your ArNS name's ANT process ID (required variable) + # DEPLOY_UNDERNAME: Optional undername to deploy to (optional variable) + - name: Check required configurations run: | if [ -z "$DEPLOY_KEY" ]; then echo "Error: DEPLOY_KEY secret is required but not set" exit 1 fi - if [ -z "$DEPLOY_ANT_PROCESS_ID" ]; then - echo "Error: DEPLOY_ANT_PROCESS_ID secret is required but not set" + if [ -z "$DEPLOY_ARNS_NAME" ]; then + echo "Error: DEPLOY_ARNS_NAME variable is required but not set" exit 1 fi env: DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - DEPLOY_ANT_PROCESS_ID: ${{ secrets.DEPLOY_ANT_PROCESS_ID }} - - # Delete package-lock so that install will use latest non breaking - - name: Delete package-lock.json - run: rm package-lock.json + DEPLOY_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} # Install project dependencies - name: Install dependencies run: npm install - # Build project - - name: Build project + # Build Project + - name: Build Project run: npm run build # Default deployment configuration: @@ -55,12 +51,12 @@ jobs: - name: Deploy with undername (default) env: DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - DEPLOY_ANT_PROCESS_ID: ${{ secrets.DEPLOY_ANT_PROCESS_ID }} - DEPLOY_UNDERNAME: ${{ secrets.DEPLOY_UNDERNAME }} + DEPLOY_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} + DEPLOY_UNDERNAME: ${{ vars.DEPLOY_UNDERNAME }} run: | if [ -z "$DEPLOY_UNDERNAME" ]; then - echo "Error: DEPLOY_UNDERNAME secret is required but not set" - echo "Please set the DEPLOY_UNDERNAME secret in your repository settings" + echo "Error: DEPLOY_UNDERNAME variable is required but not set" + echo "Please set the DEPLOY_UNDERNAME variable in your repository settings" echo "If you want to deploy without an undername, use the alternative configuration below" exit 1 fi @@ -70,10 +66,10 @@ jobs: # Alternative deployment configuration (commented out): # Use this if you want to deploy directly to the base ArNS without an undername # To use this, comment out the above "Deploy with undername" step and uncomment this one - #- name: Deploy without undername - # env: - # DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - # DEPLOY_ANT_PROCESS_ID: ${{ secrets.DEPLOY_ANT_PROCESS_ID }} - # run: | - # echo "Deploying without undername to base ArNS" - # npm run deploy + # - name: Deploy without undername + # env: + # DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + # DEPLOY_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} + # run: | + # echo "Deploying without undername to base ArNS" + # npm run deploy diff --git a/package.json b/package.json index 8a25de5..640d308 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "start": "docusaurus start", "build": "docusaurus build", "swizzle": "docusaurus swizzle", - "deploy": "permaweb-deploy --deploy-folder ./build --ant-process $DEPLOY_ANT_PROCESS_ID", - "deploy-undername": "permaweb-deploy --deploy-folder ./build --ant-process $DEPLOY_ANT_PROCESS_ID --undername $DEPLOY_UNDERNAME", + "deploy": "permaweb-deploy --deploy-folder ./build --arns-name $DEPLOY_ARNS_NAME", + "deploy-undername": "permaweb-deploy --deploy-folder ./build --arns-name $DEPLOY_ARNS_NAME --undername $DEPLOY_UNDERNAME", "clear": "docusaurus clear", "serve": "docusaurus serve", "write-heading-ids": "docusaurus write-heading-ids", @@ -32,7 +32,7 @@ "@docusaurus/module-type-aliases": "^3.8.1", "@docusaurus/tsconfig": "^3.8.1", "@docusaurus/types": "^3.8.1", - "permaweb-deploy": "^1.1.10", + "permaweb-deploy": "^2.4.0", "typescript": "~5.6.2" }, "browserslist": { @@ -50,4 +50,4 @@ "engines": { "node": ">=18.0" } -} +} \ No newline at end of file