diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 390483f..b0de53b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -11,12 +11,27 @@ on: jobs: publish: runs-on: ubuntu-latest + if: github.event.pull_request.merged == true steps: - - uses: actions/checkout@v2 + - name: Check out the repo + uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 20.x - - run: npm install - - run: npm run deploy-main + - name: Installing Dependencies + run: npm install + - name: Build Development + if: github.base_ref == 'development' + run: npm run deploy-dev env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} \ No newline at end of file + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + - name: Build Staging + if: github.base_ref == 'staging' + run: npm run deploy-staging + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + - name: Build Production + if: github.base_ref == 'main' + run: npm run deploy-main + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} \ No newline at end of file diff --git a/package.json b/package.json index 4d3134a..9322310 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "build": "vite build", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json", - "deploy-main": "npm run build && permaweb-deploy --ant-process 87OqQaiyhnCWPyM-JbdlFTJ2mHPQUl9zpoWQ6JQ5_GE" + "deploy-main": "npm run build && permaweb-deploy --ant-process 87OqQaiyhnCWPyM-JbdlFTJ2mHPQUl9zpoWQ6JQ5_GE", + "deploy-dev": "npm run build && permaweb-deploy --ant-process 87OqQaiyhnCWPyM-JbdlFTJ2mHPQUl9zpoWQ6JQ5_GE --undername dev", + "deploy-staging": "npm run build && permaweb-deploy --ant-process 87OqQaiyhnCWPyM-JbdlFTJ2mHPQUl9zpoWQ6JQ5_GE --undername staging" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1",