Refactor deployment workflow to improve Bun setup and streamline Azure Static Web Apps deployment
All checks were successful
Deploy to Azure Static Web Apps / build-and-deploy (push) Successful in 1m42s

This commit is contained in:
2025-11-28 10:40:34 -06:00
parent f1591bb9b9
commit b08d918f84

View File

@@ -13,22 +13,26 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Use Bun - name: Setup Bun
uses: oven-sh/setup-bun@v2 uses: oven-sh/setup-bun@v2
with: with:
node-version: '20' bun-version: latest
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
- name: Build - name: Build
env:
VITE_SUPABASE_URL: ${{ vars.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY: ${{ vars.VITE_SUPABASE_ANON_KEY }}
VITE_BACK_ORIGIN: ${{ vars.VITE_BACK_ORIGIN }}
run: bun run build run: bun run build
- name: Install Azure SWA CLI # No hace falta instalar el CLI globalmente, usamos bunx
run: bun install -g @azure/static-web-apps-cli
- name: Deploy to Azure Static Web Apps - name: Deploy to Azure Static Web Apps
env:
AZURE_SWA_DEPLOYMENT_TOKEN: ${{ secrets.AZURE_SWA_DEPLOYMENT_TOKEN }}
run: | run: |
swa deploy ./dist \ bunx @azure/static-web-apps-cli deploy ./dist \
--env production \ --env production \
--deployment-token "${{ secrets.AZURE_SWA_DEPLOYMENT_TOKEN }}" --deployment-token "$AZURE_SWA_DEPLOYMENT_TOKEN"