Pr preview Test

this is on my account if there is a bug letmeknow
This commit is contained in:
NOCanoa 2024-12-18 20:52:39 +00:00
parent 9d8fd48e05
commit 5393dd3dbf

60
.github/workflows/pr-testdeploy.yml vendored Normal file
View file

@ -0,0 +1,60 @@
name: Upload pr to B (NOcanoa account)
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pnpm
run: npm install -g pnpm
- name: Verify pnpm installation
run: pnpm --version
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run build
- name: Deploy to BunnyCDN
uses: ayeressian/bunnycdn-storage-deploy@v2.2.4
with:
source: "dist"
destination: "${{ github.event.number }}"
storageZoneName: "${{ secrets.STORAGE_NAME_PR }}"
storagePassword: "${{ secrets.STORAGE_PASSWORD_PR }}"
upload: "true"
remove: "false"
purgePullZone: "false"
comment:
runs-on: ubuntu-latest
needs: upload
steps:
- name: Comment on PR
uses: actions/github-script@v6
with:
script: |
const pr_number = context.issue.number;
const deploymentUrl = `https://846463563435345453554545454.b-cdn.net/setup.html`;
const comment = `The deployment is complete for PR #${pr_number} 🎉\n\nSet the value to pr number [here](${deploymentUrl}), an then just reload to / \n\n verry work in progress xD`;
github.rest.issues.createComment({
...context.issue,
issue_number: pr_number,
body: comment
});