-
Notifications
You must be signed in to change notification settings - Fork 34
102 lines (99 loc) · 2.86 KB
/
ci.yml
File metadata and controls
102 lines (99 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: evo-web CI
on:
pull_request:
types: [opened, synchronize]
push:
branches: ["main", "[1-9][0-9].*"]
concurrency:
group: "${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build:ci
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check for uncommitted changes
run: |
if output=$(git status --porcelain) && [ -z "$output" ]; then
echo "Working directory is clean. No uncommitted changes."
else
echo "Working directory has uncommitted changes or untracked files. Please run the build and check these files in as part of your PR:"
echo "$output"
exit 1 # Fail the CI run if there are uncommitted changes
fi
# Deployment job
deploy:
if: github.ref == 'refs/heads/main'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
contents: write
packages: write
pull-requests: write
issues: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Deploy job
run: npm run deploy
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site/public
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
needs: [build]
permissions:
id-token: write
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: "${{ github.repository_owner == 'ebay' && github.event_name == 'push' }}"
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Release
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release
commit: "ci: release"
title: "ci: release"
commitMode: "github-api"
env:
# Disable husky
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}