Skip to content

Commit

Permalink
feat: move to gha
Browse files Browse the repository at this point in the history
  • Loading branch information
orangedeng committed Oct 17, 2024
1 parent 538300a commit 98c9ee3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
File renamed without changes.
22 changes: 22 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pull Request

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
pr-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/fermium
- name: build
run: |
scripts/ci
35 changes: 35 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Push to Master

on:
push:
tags:
- 'v*.*.*-kube-explorer-ui-rc*'
- 'v*.*.*-kube-explorer-ui'
env:
BUCKET_NAME: 'pandaria-dashboard-ui'
AWS_REGION: '${{ vars.AWS_REGION }}'
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-session-name: upload-kube-explorer-ui
role-to-assume: arn:aws:iam::852061510766:role/github-actions-aws-s3-role
- uses: actions/setup-node@v4
with:
node-version: lts/fermium
- name: build
run: |
./scripts/build-embedded
- name: Upload static to s3
run: |
aws s3 cp dist/static/${GITHUB_REF#refs/tags/}.tar.gz s3://${{ env.BUCKET_NAME }}/kube-explorer/ --acl public-read

0 comments on commit 98c9ee3

Please sign in to comment.