Herramientas de frontal web #123
This file contains hidden or 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: Generate LiaScript Outputs | |
| # Trigger: Run the workflow when changes are pushed to the 'main' branch. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Check out the repository's code to project directory. | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: project | |
| # Step 2: Set up Node.js environment. | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' # Specify the Node.js version. | |
| # Step 3: Install the LiaScript exporter globally using npm. | |
| - name: Install LiaScript Exporter | |
| run: | | |
| npm install -g @liascript/exporter | |
| npx puppeteer browsers install chrome | |
| # Step 4: Generate a PDF from CURSO.md. | |
| - name: Generate PDF | |
| run: | | |
| liaex -i project/CURSO.md --format pdf --output documentation-${{ github.event.repository.name }} --pdf-timeout 120000 | |
| # Step 5: Generate a SCORM package. | |
| - name: Generate SCORM | |
| run: | | |
| liaex -i project/CURSO.md --format scorm2004 --output scorm-${{ github.event.repository.name }} | |
| # Step 6: Generate an IMS package. | |
| - name: Generate IMS Package | |
| run: | | |
| liaex -i project/CURSO.md --format ims --output ims-${{ github.event.repository.name }} | |
| # Step 7: Delete existing 'latest' release and create new one with all assets. | |
| - name: Delete existing 'latest' release (if any) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release delete latest -y --cleanup-tag --repo ${{ github.repository }} || true | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: latest | |
| name: 'Última documentación de LiaScript - ${{ github.event.repository.name }}' | |
| files: | | |
| documentation-${{ github.event.repository.name }}.pdf | |
| scorm-${{ github.event.repository.name }}.zip | |
| ims-${{ github.event.repository.name }}.zip | |
| asset_content_type: application/zip |