ci: changed ci name and made it use node base img
Some checks failed
CI / build-and-publish (push) Failing after 0s
Some checks failed
CI / build-and-publish (push) Failing after 0s
it now uses node-latest by default and runs everything as shell commands instead of github actions
This commit is contained in:
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-publish:
|
||||||
|
runs-on: node-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci --prefer-offline
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: npm run format:check
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: Build CDN assets and npm package
|
||||||
|
run: |
|
||||||
|
npm run build
|
||||||
|
npm run build:raw
|
||||||
|
|
||||||
|
- name: Publish to Gitea npm registry
|
||||||
|
if: success()
|
||||||
|
env:
|
||||||
|
GITEA_HOST: ${{ secrets.GITEA_HOST }}
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
OWNER="${{ github.repository_owner }}"
|
||||||
|
echo "//${GITEA_HOST}/api/packages/${OWNER}/npm/:_authToken=${GITEA_TOKEN}" > .npmrc
|
||||||
|
npm publish \
|
||||||
|
--registry "https://${GITEA_HOST}/api/packages/${OWNER}/npm" \
|
||||||
|
--ignore-scripts
|
||||||
47
.github/workflows/ready.yml
vendored
47
.github/workflows/ready.yml
vendored
@@ -1,47 +0,0 @@
|
|||||||
name: Build and Deploy to CDN
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: npm test
|
|
||||||
|
|
||||||
- name: Build CDN assets
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Build npm package
|
|
||||||
run: npm run build:raw
|
|
||||||
|
|
||||||
- name: Publish to Gitea npm registry
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
run: |
|
|
||||||
echo "//${{ secrets.GITEA_HOST || 'git.db123.ir' }}/api/packages/${{ github.repository_owner }}/${{ github.event.repository.name }}/npm/:_authToken=${GITEA_TOKEN}" > .npmrc
|
|
||||||
npm publish --registry https://${{ secrets.GITEA_HOST || 'git.db123.ir' }}/api/packages/${{ github.repository_owner }}/${{ github.event.repository.name }}/npm
|
|
||||||
|
|
||||||
- name: Upload CDN build as artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: cdn-build
|
|
||||||
path: dist/
|
|
||||||
retention-days: 7
|
|
||||||
Reference in New Issue
Block a user