Ejecutar Script de Playwright Diariamente con Bun #3380
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ejecutar Script de Playwright Diariamente con Bun | |
# Controla cuándo se ejecutará el workflow. | |
on: | |
schedule: | |
# Ejecuta el trabajo cada 30 minutos | |
- cron: '*/30 * * * *' | |
# Permite ejecutar manualmente este workflow desde GitHub Actions. | |
workflow_dispatch: | |
jobs: | |
run-playwright: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout del repositorio. | |
- name: Checkout del repositorio | |
uses: actions/checkout@v3 | |
# 2. Instalar Bun. | |
- name: Instalar Bun | |
run: | | |
curl -fsSL https://bun.sh/install | bash | |
echo "/home/runner/.bun/bin" >> $GITHUB_PATH | |
# 3. Instalar dependencias con Bun. | |
- name: Instalar dependencias con Bun | |
run: bun install | |
# 4. Instalar navegadores de Playwright. | |
- name: Instalar navegadores de Playwright | |
run: bunx playwright install | |
# 5. Ejecutar el script usando Bun. | |
- name: Ejecutar script de Playwright | |
run: bun run index.js | |
# 6. Commit y Push de los cambios | |
- name: Commit y Push de los cambios | |
uses: actions-js/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
commit_message: "Auto commit test" | |
files: test.txt | |
target_branch: main | |
force: true |