history: deployment #14
This file contains hidden or 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: Arweave Deploy | |
| # Trigger deployment only when pushing to the master branch | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| Arweave-build-and-deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| VITE_GA4_MEASUREMENT_ID: ${{ vars.GA4_MEASUREMENT_ID }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' | |
| # 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_ARNS_NAME" ]; then | |
| echo "Error: DEPLOY_ARNS_NAME variable is required but not set" | |
| exit 1 | |
| fi | |
| env: | |
| DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
| DEPLOY_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} | |
| # Install project dependencies | |
| - name: Install dependencies | |
| run: npm install | |
| # Default deployment configuration: | |
| # This requires DEPLOY_UNDERNAME to be set, ensuring deployments always use an undername | |
| # - name: Deploy with undername (default) | |
| # env: | |
| # DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
| # DEPLOY_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} | |
| # DEPLOY_UNDERNAME: ${{ vars.DEPLOY_UNDERNAME }} | |
| # run: | | |
| # if [ -z "$DEPLOY_UNDERNAME" ]; then | |
| # 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 | |
| # echo "Deploying with undername: $DEPLOY_UNDERNAME" | |
| # npm run deploy-undername | |
| # 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_ARNS_NAME: ${{ vars.DEPLOY_ARNS_NAME }} | |
| run: | | |
| echo "Deploying without undername to base ArNS" | |
| npm run deploy |