astro-ghostcms/.github/workflows/astro-ghostcms.yml

54 lines
1.4 KiB
YAML
Raw Normal View History

2024-01-23 20:03:56 +00:00
name: Publish Astro-GhostCMS
2024-01-16 08:40:22 +00:00
on:
release:
2024-01-23 20:03:56 +00:00
types: [published]
2024-01-16 08:40:22 +00:00
jobs:
2024-01-16 09:03:15 +00:00
publishnpm:
2024-01-16 08:40:22 +00:00
runs-on: ubuntu-latest
2024-01-23 20:03:56 +00:00
defaults:
run:
working-directory: ./packages/astro-ghostcms
2024-01-16 08:40:22 +00:00
steps:
- name: checkout
2024-01-30 17:18:27 +00:00
uses: actions/checkout@v4
2024-01-16 08:40:22 +00:00
- name: node
2024-01-30 17:18:27 +00:00
uses: actions/setup-node@v4
2024-01-16 08:40:22 +00:00
with:
2024-01-30 17:18:27 +00:00
node-version: 20
2024-01-16 08:40:22 +00:00
registry-url: https://registry.npmjs.org/
- name: publish-npm
2024-01-16 09:03:15 +00:00
run: |
# Change publish registry
echo "$(jq '.publishConfig.registry = "https://registry.npmjs.org"' package.json)" > package.json
# Publish package
2024-01-24 00:31:09 +00:00
npm publish
2024-01-16 08:40:22 +00:00
env:
2024-01-16 08:42:36 +00:00
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2024-01-16 09:03:15 +00:00
githubpackage:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
2024-01-23 20:03:56 +00:00
defaults:
run:
working-directory: ./packages/astro-ghostcms
2024-01-16 09:03:15 +00:00
steps:
- name: checkout
2024-01-30 17:18:27 +00:00
uses: actions/checkout@v4
2024-01-16 09:03:15 +00:00
- name: node
2024-01-30 17:18:27 +00:00
uses: actions/setup-node@v4
2024-01-16 09:03:15 +00:00
with:
2024-01-30 17:18:27 +00:00
node-version: 20
2024-01-16 09:03:15 +00:00
registry-url: https://npm.pkg.github.com
- name: publish-github
run: |
# Change publish registry
echo "$(jq '.publishConfig.registry = "https://npm.pkg.github.com"' package.json)" > package.json
# Publish package
2024-01-24 00:31:09 +00:00
npm publish
2024-01-16 09:03:15 +00:00
env:
2024-01-16 09:06:27 +00:00
NODE_AUTH_TOKEN: ${{secrets.ACTION_TOKEN}}