Skip to content

Commit d3b398e

Browse files
committed
split files, add s3 push
1 parent 825c63c commit d3b398e

File tree

3 files changed

+84
-7
lines changed

3 files changed

+84
-7
lines changed

.github/workflows/build-alpha.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
tags:
6+
- '**' # Currently any tag, need to slim down
7+
paths:
8+
- pyscriptjs/**
9+
- .github/workflows/** # Test that workflows work when changed
10+
11+
pull_request:
12+
paths:
13+
- pyscriptjs/**
14+
- .github/workflows/**
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
id-token: write
22+
defaults:
23+
run:
24+
working-directory: ./pyscriptjs
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Install node
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 12.x
33+
- name: Cache node modules
34+
uses: actions/cache@v3
35+
env:
36+
cache-name: cache-node-modules
37+
with:
38+
# npm cache files are stored in `~/.npm` on Linux/macOS
39+
path: ~/.npm
40+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
41+
restore-keys: |
42+
${{ runner.os }}-build-${{ env.cache-name }}-
43+
${{ runner.os }}-build-
44+
${{ runner.os }}-
45+
- name: Install dependencies
46+
run: |
47+
npm install
48+
- name: Build pyscript
49+
run: |
50+
npm run build
51+
# Deploy to S3
52+
- name: Configure AWS credentials
53+
uses: aws-actions/configure-aws-credentials@v1.6.1
54+
with:
55+
aws-region: ${{secrets.AWS_REGION}}
56+
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
57+
- name: Sync to S3
58+
run: aws s3 sync . s3://pyscript-static/unstable/ # What artifacts exactly need to be copied?

.github/workflows/build.yml renamed to .github/workflows/build-unstable.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Build
22

33
on:
44
push: # Only run on merges into master that modify files under pyscriptjs/
5-
branches: main
5+
branches:
6+
- main
67
paths:
78
- pyscriptjs/**
89
- .github/workflows/** # Test that workflows work when changed
@@ -13,11 +14,14 @@ on:
1314
- .github/workflows/**
1415

1516
jobs:
16-
build:
17-
runs-on: ubuntu-latest # Will be self hosted soon
18-
defaults:
19-
run:
20-
working-directory: ./pyscriptjs
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
id-token: write
22+
defaults:
23+
run:
24+
working-directory: ./pyscriptjs
2125

2226
steps:
2327
- name: Checkout
@@ -44,3 +48,11 @@ jobs:
4448
- name: Build pyscript
4549
run: |
4650
npm run build
51+
# Deploy to S3
52+
- name: Configure AWS credentials
53+
uses: aws-actions/configure-aws-credentials@v1.6.1
54+
with:
55+
aws-region: ${{secrets.AWS_REGION}}
56+
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
57+
- name: Sync to S3
58+
run: aws s3 sync . s3://pyscript-static/unstable/ # What artifacts exactly need to be copied?

.github/workflows/lint.yml renamed to .github/workflows/js-lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: Lint
22

33
on:
4+
45
push: # Only run on merges into master that modify files under pyscriptjs/
56
branches:
67
- main
8+
paths:
9+
- pyscriptjs/**
10+
- .github/workflows/** # Test that workflows work when changed
711

8-
pull_request: # Run on any PR that modifies files in pyscriptjs/
12+
pull_request: # Run on any PR that modifies files in pyscriptjs/
13+
paths:
14+
- pyscriptjs/**
15+
- .github/workflows/**
916

1017
jobs:
1118
build:

0 commit comments

Comments
 (0)