Skip to content

Commit 852720f

Browse files
author
崔庆才丨静觅
authored
Create deploy.yml
1 parent 1ae0c2a commit 852720f

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- .gitignore
8+
- README.md
9+
- '.github/ISSUE_TEMPLATE/**'
10+
jobs:
11+
run:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@master
16+
- name: Docker Login
17+
uses: Azure/docker-login@v1
18+
with:
19+
username: germey
20+
password: ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }}
21+
- name: Set Kubectl
22+
uses: Azure/k8s-set-context@v1
23+
with:
24+
kubeconfig: ${{ secrets.KUBE_CONFIG }}
25+
- name: Test Kubectl
26+
run: |
27+
kubectl get nodes
28+
kubectl get svc -n scrape
29+
- name: Generate Build Number
30+
uses: einaregilsson/build-number@v2
31+
with:
32+
token: ${{ secrets.github_token }}
33+
- name: Get Build Number
34+
run: |
35+
echo $BUILD_NUMBER
36+
- name: Build Push Deploy
37+
run: |
38+
docker-compose build
39+
docker tag germey/proxypool germey/proxypool:$BUILD_NUMBER
40+
docker push germey/proxypool:$BUILD_NUMBER
41+
cat deployment.yml | sed 's/\${TAG}/'"$BUILD_NUMBER"'/g' | kubectl apply -f -
42+

0 commit comments

Comments
 (0)