diff --git a/.github/workflows/preview-app.yaml b/.github/workflows/preview-app.yaml new file mode 100644 index 000000000..852b7196d --- /dev/null +++ b/.github/workflows/preview-app.yaml @@ -0,0 +1,29 @@ +name: Deploy Preview App + +on: + pull_request: + +jobs: + deploy-preview: + runs-on: ubuntu-latest + name: Deploy Preview App + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Build dist + run: mv .env.sample .env && npm install && npm run build + + - name: Deploy to Cloudflare Pages + id: deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + command: pages deploy dist --project-name=algokit-lora --branch=${{ github.head_ref }} + + - name: Print URL + env: + DEPLOYMENT_ALIAS_URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }} + run: echo $DEPLOYMENT_ALIAS_URL