Merge pull request #527 from Deeksha1502/github-artifact-url #11
Workflow file for this run
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: Publish Content Player Package | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| name: Build and Publish Content Player Package | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '10.16.3' | |
| cache: 'npm' | |
| cache-dependency-path: 'player/package-lock.json' | |
| - name: Restore node_modules cache | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: player/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Configure git to use HTTPS | |
| run: git config --global url."https://".insteadOf git:// | |
| - name: Install Python 2 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python2 | |
| sudo ln -sf /usr/bin/python2 /usr/bin/python | |
| - name: Set npm python config | |
| run: npm config set python /usr/bin/python2 | |
| - name: Install dependencies | |
| working-directory: player | |
| run: npm i --legacy-peer-deps | |
| - name: Save node_modules cache | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| uses: actions/cache@v4 | |
| with: | |
| path: player/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
| - name: Build preview | |
| working-directory: player | |
| run: npm run build-preview ekstep | |
| - name: Compress preview | |
| working-directory: player | |
| run: grunt compress:preview | |
| - name: Generate libs | |
| working-directory: player | |
| run: grunt generate-libs | |
| - name: Build and publish package | |
| working-directory: player | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| npm run build-npm-package | |
| echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
| npm pack ./www/preview | |
| npm publish project-sunbird-content-player-* --access public | |