ci: caddyfile #7
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: Release Versions or Publish NPM | |
on: | |
push: | |
branches: | |
- main | |
# This is for .npmrc. Nx automatically creates an .npmrc before changesets runs | |
# and creates one itself, so we need to explicitly have one. | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
concurrency: commits-to-main | |
jobs: | |
release-main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout all commits | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./.github/actions/setup | |
with: | |
node_version: 19.5.0 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Workspace lint | |
shell: bash | |
run: npx nx workspace-lint | |
- name: Lint | |
shell: bash | |
run: npx nx run-many --target=lint --all --parallel=5 | |
- name: Test | |
shell: bash | |
run: npx nx run-many --target=test --all --parallel=5 | |
- name: Build for publishing | |
shell: bash | |
# configuration ci will put the dists in each project directory so changesets can publish | |
# NOTE: changed from ci to production and added script for copy | |
run: npx nx run-many --target=build --configuration=production --all --parallel=5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
ASSETS: ${{ github.workspace }}/assets | |
- name: Copy dists for publishing | |
run: ./scripts/copy-dists-for-publishing.sh | |
- name: Create Release Pull Request or Publish to NPM | |
uses: changesets/action@v1 | |
with: | |
commit: 'chore: release packages' | |
publish: npm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Containers | |
shell: bash | |
run: npx nx run-many --target=container --configuration=production -all --parallel=5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
ASSETS: ${{ github.workspace }}/assets |