Debug .npmrc #54
This file contains 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: 'Build and Publish Docker Image' | |
on: | |
push: | |
branches: | |
- 'fix/*' | |
jobs: | |
publish-to-github: | |
name: Publish to Github | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
env: | |
NPM_CONFIG_PROVENANCE: true | |
outputs: | |
release: ${{ steps.set-release.outputs.release }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Debug Publish Branch | |
run: echo "${{ github.ref_name }}" | |
- run: corepack enable | |
- uses: actions/[email protected] | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@bitovi' | |
- run: pnpm install --frozen-lockfile | |
- name: Set release version in env | |
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV | |
- name: Build | |
run: pnpm build | |
- name: Cache build artifacts | |
uses: actions/cache/[email protected] | |
with: | |
path: ./packages/**/dist | |
key: ${{ github.sha }}-release:build | |
- name: Dry Run Publish | |
run: pnpm publish -r --publish-branch ${{ github.ref_name }} --dry-run | |
- name: Publish to GitHub Packages | |
run: | | |
echo "@n8n_io:registry=https://npm.pkg.github.com" > .npmrc | |
echo "@n8n:registry=https://npm.pkg.github.com" >> .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc | |
node .github/scripts/trim-fe-packageJson.js | |
node .github/scripts/ensure-provenance-fields.mjs | |
sed -i "s/default: 'dev'/default: 'stable'/g" packages/cli/dist/config/schema.js | |
pnpm publish -r --publish-branch ${{ github.ref_name }} --access public --tag rc --no-git-checks | |
- name: Debug .npmrc | |
run: cat .npmrc | |
- id: set-release | |
run: echo "release=${{ env.RELEASE }}" >> $GITHUB_OUTPUT | |
build-and-push: | |
needs: [publish-to-github] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Debugging1 | |
run: ls -R ./docker/images/n8n | |
- name: Debugging2 | |
run: cat ./docker/images/n8n/Dockerfile | |
- name: Build and Push Docker Image | |
uses: docker/[email protected] | |
with: | |
context: ./docker/images/n8n | |
build-args: | | |
N8N_VERSION=${{ needs.publish-to-github.outputs.release }} | |
platforms: linux/amd64,linux/arm64 | |
provenance: false | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/n8n:${{ needs.publish-to-github.outputs.release }} | |