Skip to content

Commit 21c196b

Browse files
authored
Merge pull request #55 from flowplayer/refactor/fa-722/update-gha-build-and-deploy
Refactor: [fa-722] update gha build and deploy
2 parents 740c6bc + 72a61fb commit 21c196b

7 files changed

Lines changed: 41 additions & 36 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
name: deploy
22
on:
3-
push:
3+
pull_request:
44
branches:
55
- main
6+
types:
7+
- closed
8+
permissions:
9+
id-token: write
10+
contents: read
11+
pages: write
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
615
jobs:
7-
build:
16+
deploy:
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
820
runs-on: ubuntu-latest
921
steps:
1022
- uses: actions/checkout@v4
1123
- uses: actions/setup-node@v4
1224
with:
13-
node-version: 18
25+
node-version: 20
26+
cache: yarn
1427
- id: yarn-cache-path
15-
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
1629
- uses: actions/cache@v4
1730
with:
1831
path: ${{ steps.yarn-cache-path.outputs.dir }}
1932
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
2033
restore-keys: |
2134
${{ runner.os }}-yarn-
22-
- run: yarn install --immutable
23-
- run: yarn demo
24-
- id: deployment
25-
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
35+
- name: Build demo page
36+
run: |
37+
yarn install --immutable
38+
yarn demo
39+
- name: Upload demo page
40+
uses: actions/upload-pages-artifact@v3
2641
with:
27-
path: demo/dist/
28-
29-
# Deploy job
30-
deploy:
31-
# Add a dependency to the build job
32-
needs: build
33-
34-
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
35-
permissions:
36-
pages: write # to deploy to Pages
37-
id-token: write # to verify the deployment originates from an appropriate source
38-
39-
# Specify runner + deployment step
40-
runs-on: ubuntu-latest
41-
steps:
42+
path: './demo/public'
4243
- name: Deploy to GitHub Pages
4344
id: deployment
44-
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
45-
env:
46-
name: preview
47-
url: ${{ steps.deployment.outputs.page_url }}
45+
uses: actions/deploy-pages@v4
46+
# - name: Publish to NPMJS
47+
# uses: JS-DevTools/npm-publish@v3
48+
# with:
49+
# token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,5 @@ dist
104104
.tern-port
105105
lib
106106

107-
.DS_Store
107+
.DS_Store
108+
.secrets

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Flowplayer
3+
Copyright (c) 2025 Flowplayer
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
File renamed without changes.

demo/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ module.exports = {
3131
},
3232
output: {
3333
filename: "[name].js",
34-
path: path.resolve(__dirname, "dist")
34+
path: path.resolve(__dirname, "public")
3535
},
3636
devServer: {
3737
static: {
38-
directory: path.resolve(__dirname)
38+
directory: path.resolve(__dirname, "public")
3939
}
4040
}
4141
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"author": "Flowplayer AB <info@flowplayer.com>",
88
"license": "MIT",
99
"private": false,
10+
"types": "index.d.ts",
1011
"scripts": {
1112
"build": "tsc -d",
1213
"dev": "webpack serve -c demo/webpack.config.js",
@@ -38,4 +39,4 @@
3839
"lib/*.js",
3940
"lib/*.d.ts"
4041
]
41-
}
42+
}

tsconfig.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"test/**/*.test-d.tsx" // we have a separate task where types are tested
88
],
99
"compilerOptions": {
10-
"target": "es2015",
10+
"allowSyntheticDefaultImports": true,
11+
"declaration": false,
1112
"jsx": "react",
13+
"moduleResolution": "node",
14+
"outDir": "./lib",
1215
"skipLibCheck": true,
13-
"allowSyntheticDefaultImports": true,
1416
"strict": true,
15-
"outDir": "./lib",
16-
"moduleResolution": "node"
17+
"target": "es2015",
1718
}
1819
}

0 commit comments

Comments
 (0)