Skip to content

Commit

Permalink
ci(backstage-plugin): Publish to GHCR on release (#111)
Browse files Browse the repository at this point in the history
Publish to both npm and GHCR when publishing a release so that the repo registry is kept up-to-date.

Remove unneeded env var from pr publish job.

Addresses #61
  • Loading branch information
kylejwatson authored Nov 27, 2023
1 parent ec4f07e commit 273e9dd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/pr-backstage-plugin-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ jobs:
yarn publish --non-interactive --tag pr
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
38 changes: 38 additions & 0 deletions .github/workflows/publish-backstage-plugin-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,41 @@ jobs:
run: yarn publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publishGHCR:
name: publish to GitHub registry
runs-on: ubuntu-latest
timeout-minutes: 20

defaults:
run:
working-directory: backstage-plugin
steps:
- uses: actions/checkout@v4

- name: setup nodejs
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: backstage-plugin/yarn.lock
registry-url: https://npm.pkg.github.com/
always-auth: true

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: type checking and declarations
run: yarn tsc

- name: build
run: yarn build:all

- name: publish
working-directory: backstage-plugin/plugins/open-dora
run: |
# Replace the @devoteam-nl with @devoteamnl in package.json
sed -i 's/"@devoteam-nl\//"@devoteamnl\//g' package.json
yarn publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 273e9dd

Please sign in to comment.