add actions
This commit is contained in:
1 parent
07c1b535f4
commit
0872579aee
4 files changed
+52
-1
No files matched your search
@@ -0,0 +1,46 @@
|
||||
name: deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- .gitignore
|
||||
- README.md
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Test IP Address
|
||||
run: |
|
||||
wget -qO- https://ipecho.net/plain ; echo
|
||||
- name: Set Kubectl
|
||||
uses: Azure/k8s-set-context@v1
|
||||
with:
|
||||
kubeconfig: ${{ secrets.KUBE_CONFIG }}
|
||||
- name: Test Kubectl
|
||||
run: |
|
||||
kubectl get nodes
|
||||
kubectl get svc -n zhishuyun-test
|
||||
- name: Generate Build Number
|
||||
uses: einaregilsson/build-number@v2
|
||||
with:
|
||||
token: ${{ secrets.github_token }}
|
||||
env:
|
||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||
- name: Get Build Number
|
||||
run: |
|
||||
echo $BUILD_NUMBER
|
||||
- name: Build Push Deploy
|
||||
run: |
|
||||
docker-compose build
|
||||
docker-compose push
|
||||
sh ./deploy/test/deploy.sh
|
||||
@@ -4,6 +4,7 @@ WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn
|
||||
COPY . .
|
||||
RUN yarn run init:https
|
||||
RUN yarn build
|
||||
|
||||
# production stage
|
||||
|
||||
File renamed without changes.
+5
-1
@@ -12,7 +12,10 @@
|
||||
"build:production": "npm run build --env=production",
|
||||
"serve": "vite preview",
|
||||
"lint": "npx eslint src --fix --ext .ts,.tsx,.vue,.js,.jsx",
|
||||
"prettier": "npx prettier --write ."
|
||||
"prettier": "npx prettier --write .",
|
||||
"init:https": "npm run init:ca && npm run init:cert",
|
||||
"init:ca": "npx mkcert create-ca --validity 36500 --key certs/auth.local.zhishuyun.com.ca.key --cert certs/auth.local.zhishuyun.com.ca.crt",
|
||||
"init:cert": "npx mkcert create-cert --ca-key certs/auth.local.zhishuyun.com.ca.key --ca-cert certs/auth.local.zhishuyun.com.ca.crt --validity 36500 --key certs/auth.local.zhishuyun.com.cert.key --cert certs/auth.local.zhishuyun.com.cert.crt --domains auth.local.zhishuyun.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/uuid": "^8.3.4",
|
||||
@@ -54,6 +57,7 @@
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"eslint-plugin-vue": "^8.5.0",
|
||||
"husky": "^7.0.2",
|
||||
"mkcert": "^1.4.0",
|
||||
"postcss": "^8.3.6",
|
||||
"prettier": "^2.6.2",
|
||||
"rollup-plugin-string": "^3.0.0",
|
||||
|
||||
Reference in new issue
Block a user