Skip to content

Commit

Permalink
open acton
Browse files Browse the repository at this point in the history
  • Loading branch information
csic21 committed Aug 1, 2024
1 parent 6218163 commit 8a27c21
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
# name: Docker Image CI
name: Docker Image CI

# on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Make envfile
# uses: SpicyPizza/create-envfile@v1
# with:
# envkey_VSSUEID: ${{ secrets.VSSUEID }}
# envkey_VSSUESECRET: ${{ secrets.VSSUESECRET }}
# file_name: .env
# - name: Build the Docker image
# uses: actions/setup-node@v2
# with:
# node-version: 16
# - run: npm install
# - run: npm run build
# - run: docker login --username=${{ secrets.DOCKER_USERNAME }} registry.cn-hangzhou.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }}
# - run: docker build . --file Dockerfile --tag registry.cn-hangzhou.aliyuncs.com/milkhall/blog:${{ github.sha }}
# - run: docker push registry.cn-hangzhou.aliyuncs.com/milkhall/blog:${{ github.sha }}
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: ls
# - run: sed -i 's/{TAG}/${{ github.sha }}/g' nginx-deployment.yml
# - name: deploy to cluster
# uses: steebchen/kubectl@master
# with:
# config: ${{ secrets.KUBE_CONFIG_DATA }}
# version: v1.22.7
# command: apply -f nginx-deployment.yml
# # - name: verify deployment
# # uses: steebchen/kubectl@master
# # with:
# # version: v1.22.7
# # config: ${{ secrets.KUBE_CONFIG_DATA }}
# # command: '"rollout status -n blog deployment/blog"'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_VSSUEID: ${{ secrets.VSSUEID }}
envkey_VSSUESECRET: ${{ secrets.VSSUESECRET }}
file_name: .env
- name: Build the Docker image
uses: actions/setup-node@v2
with:
node-version: 16
- run: npm install
- run: npm run build
- run: docker login --username=${{ secrets.DOCKER_USERNAME }} registry.cn-hangzhou.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }}
- run: docker build . --file Dockerfile --tag registry.cn-hangzhou.aliyuncs.com/milkhall/blog:${{ github.sha }}
- run: docker push registry.cn-hangzhou.aliyuncs.com/milkhall/blog:${{ github.sha }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ls
- run: sed -i 's/{TAG}/${{ github.sha }}/g' nginx-deployment.yml
- name: deploy to cluster
uses: steebchen/kubectl@master
with:
config: ${{ secrets.KUBE_CONFIG_DATA }}
version: v1.22.7
command: apply -f nginx-deployment.yml
# - name: verify deployment
# uses: steebchen/kubectl@master
# with:
# version: v1.22.7
# config: ${{ secrets.KUBE_CONFIG_DATA }}
# command: '"rollout status -n blog deployment/blog"'

0 comments on commit 8a27c21

Please sign in to comment.