Skip to content

Commit

Permalink
Deployment/test3 (#84)
Browse files Browse the repository at this point in the history
* feat: test deployment
  • Loading branch information
hunjixin authored Jan 24, 2024
1 parent fb5ed26 commit 35a4abe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Print Event
run: |
echo "Event Name: ${{ github.event_name }}"
echo "Repository: ${{ github.repository }}"
echo "SHA: ${{ github.sha }}"
echo "Ref: ${{ github.ref }}"
echo "Action: ${{ github.action }}"
echo "Actor: ${{ github.actor }}"
echo "Workflow Run ID: ${{ github.run_id }}"
echo "Head Repository: ${{ github.head_repository }}"
echo "Base Repository: ${{ github.base_repository }}"
- name: Checkout repo
uses: actions/checkout@v3

Expand All @@ -19,4 +31,4 @@ jobs:
uses: bahmutov/npm-install@v1

- name: Build project
run: npm run build
run: npm run build
11 changes: 7 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ on:
required: true
jobs:
deployment:
if: ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/master' }}
if: ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/main' }}
runs-on: [self-hosted]
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

with:
node-version: 18

- name: Install dependencies
uses: bahmutov/npm-install@v1

Expand All @@ -39,13 +41,14 @@ jobs:
- name: Build and push
run: |
ls dist
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker build -t gitdatateam/jiaozifs-ui:${{ steps.version.outputs.version }} .
docker push gitdatateam/jiaozifs-ui:${{ steps.version.outputs.version }}
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm install jiaozifs-ui ./chart/ --namespace jiaozifs --set-string api_url=${{ secrets.JIAOZI_API_URL }} --set-string tag=${{ steps.version.outputs.version }}
exec: helm upgrade jiaozifs-ui --install ./chart/ --namespace jiaozifs --set-string api_url=${{ secrets.JIAOZI_API_URL }} --set-string tag=${{ steps.version.outputs.version }}
kubeconfig: ${{ secrets.KUBECONTENT }}
overrule_existing_kubeconfig: "true"
3 changes: 2 additions & 1 deletion .github/workflows/flow.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: test

on:
create:
push:
branches:
- main
- 'deployment/**'
- deployment/**
pull_request:
branches:
- '**'
Expand Down

0 comments on commit 35a4abe

Please sign in to comment.