Skip to content

Commit d556a54

Browse files
authored
chore / fix up linting issue and reuse CI actions (#23)
* chore: fix up linting issue * ci: remove ci run on branches that target the main branch tests.yml is taking care of that. Otherwise we execute it twice since the commands do the same things * ci: update action to use v4 * ci: add emoji to visualize stage * ci: rework pipeline to include all required steps * ci: add conditions and build artifact handling * ci: rename job to align with it's action
1 parent 6fd32b6 commit d556a54

File tree

4 files changed

+68
-87
lines changed

4 files changed

+68
-87
lines changed

.github/workflows/_tests.yml

+31
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,37 @@ jobs:
2424

2525
- run: pnpm build
2626

27+
- name: 🔺 Upload frontend distribution artifacts
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: build_distribution
31+
path: theme/dist
32+
if-no-files-found: error
33+
retention-days: 1
34+
35+
build_playground:
36+
needs: build
37+
name: 🛝 Build Playground
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: 🔻 Download build artifacts
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: build_distribution
46+
path: theme/dist
47+
48+
- uses: ./.github/actions/setup
49+
50+
- run: pnpm build:testing
51+
52+
- name: Upload artifact
53+
if: github.ref == 'refs/heads/main'
54+
uses: actions/upload-pages-artifact@v1
55+
with:
56+
path: testing/dist
57+
2758
unit_tests:
2859
name: 🧪 Unit Tests
2960
runs-on: ubuntu-latest

.github/workflows/build.yml

-84
This file was deleted.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 🛝 Publish Playground
2+
3+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
4+
permissions:
5+
contents: read
6+
pages: write
7+
id-token: write
8+
9+
# Controls when the workflow will run
10+
on:
11+
# Triggers the workflow on push or pull request events but only for the "main" branch
12+
push:
13+
branches: ['main']
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
tests:
21+
uses: ./.github/workflows/_tests.yml
22+
secrets: inherit
23+
24+
publish:
25+
name: 🛝 Publish Playground to GitHub Pages
26+
# The type of runner that the job will run on
27+
runs-on: ubuntu-latest
28+
needs: tests
29+
30+
# Steps represent a sequence of tasks that will be executed as part of the job
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Deploy to GitHub Pages
35+
id: deployment
36+
uses: actions/deploy-pages@v4

theme/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"module": "./dist/index.es.js",
1111
"types": "./dist/index.es.d.ts"
1212
},
13-
"files": [
14-
"dist"
15-
],
13+
"files": ["dist"],
1614
"scripts": {
1715
"build": "pnpm build:types && pnpm build:lib",
1816
"build:lib": "vite build",

0 commit comments

Comments
 (0)