Skip to content

Commit 3259d79

Browse files
committed
feat: move to GHA
1 parent d5bd52e commit 3259d79

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

.drone.yaml .drone.bk.yaml

File renamed without changes.

.github/workflows/pr.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Push to Master
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
jobs:
11+
pr-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: lts/gallium
20+
- name: build
21+
run: |
22+
npm install
23+
npm run lint
24+
UI_BASE_PATH=//s3-ap-southeast-2.amazonaws.com/autok3s-ui/static/ npm run build

.github/workflows/push.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Push to Master
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*' # Matches any tag that starts with 'v' and follows semantic versioning
9+
- 'v*.*.*-rc*'
10+
env:
11+
BUCKET_NAME: 'autok3s-ui'
12+
AWS_REGION: '${{ vars.AWS_REGION }}'
13+
permissions:
14+
id-token: write # This is required for requesting the JWT
15+
contents: read # This is required for actions/checkout
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/heads/')}}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Configure AWS credentials
27+
uses: aws-actions/configure-aws-credentials@v4
28+
with:
29+
aws-region: ${{ env.AWS_REGION }}
30+
role-session-name: upload-autok3s-ui
31+
role-to-assume: arn:aws:iam::852061510766:role/github-actions-aws-s3-role
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: lts/gallium
35+
- name: build
36+
run: |
37+
npm install
38+
npm run lint
39+
UI_BASE_PATH=//s3-ap-southeast-2.amazonaws.com/autok3s-ui/static/ npm run build
40+
- name: build static
41+
if: startsWith(github.ref, 'refs/tags/')
42+
run: |
43+
./scripts/build-static
44+
- name: Upload tgz file to s3
45+
if: startsWith(github.ref,'refs/tags/')
46+
run: |
47+
aws s3 cp "./dist/${GITHUB_REF#refs/tags/}.tag.gz" s3://${{ env.BUCKET_NAME }}/ --acl public-read
48+
- name: Upload static to s3
49+
if: startsWith(github.ref,'refs/heads/')
50+
run: |
51+
aws s3 sync dist/static/ s3://${{ env.BUCKET_NAME }}/static/ --acl public-read --delete

0 commit comments

Comments
 (0)