Publish daily #21
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 daily | |
| on: | |
| schedule: | |
| - cron: "58 5 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: mdn/content commit to publish a release from | |
| required: false | |
| type: string | |
| dryRun: | |
| description: Don't actually publish to npm | |
| required: false | |
| type: boolean | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| publish: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # trusted publishing + attestations | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version-file: ".tool-versions" | |
| check-latest: true | |
| registry-url: "https://registry.npmjs.org" | |
| - run: npm install -g 'npm@>=11.5.1' # required for trusted publishing | |
| - run: npm ci | |
| - run: | | |
| if [ -n "$REF" ]; then | |
| npm run build -- --verbose --ref="$REF" | |
| else | |
| npm run build -- --verbose | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REF: ${{ inputs.ref }} | |
| - if: ${{ inputs.dryRun }} | |
| run: npm run publish:dry-run | |
| - if: ${{ ! inputs.dryRun }} | |
| run: npm run publish | |
| - run: npm info @mdn/content-inventory |