From c91b1426b1e4ea532543dc3a8df6512dae1115d8 Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Fri, 4 Apr 2025 14:44:29 +0200 Subject: [PATCH] ci: add dev deplyment workflow --- .github/workflows/deploy.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..debf5de --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,51 @@ +name: Deploy + +on: + workflow_dispatch: + push: + branches: + - main + - dev + pull_request: + branches: + - dev +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + cache: npm + + - name: Install dependencies + run: npm i + + - name: Build + # env: + # RV_API_URL: ${{ vars.RV_API_URL }} + # RV_GOOGLE_TAG_MANAGER_ID: ${{ vars.RV_GOOGLE_TAG_MANAGER_ID }} + # RV_DMCA_GUID: ${{ vars.RV_DMCA_GUID }} + run: npm run build + + - name: Deploy + id: deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy public --project-name=revanced-website + + - name: Comment deployment URL + if: ${{ github.event_name == 'pull_request' }} + uses: thollander/actions-comment-pull-request@v2 + with: + message: Deployed at ${{ steps.deploy.outputs.deployment-url }}.