Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Aug 28, 2023
1 parent 35fb874 commit 6aebc1b
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/_build_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Pull, build, push and deploy
on:
on:
workflow_call:
inputs:
ckb-mode:
Expand All @@ -26,7 +26,7 @@ on:
required: true
KUBOARD_API_URL:
required: true
jobs:
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
Expand All @@ -41,23 +41,21 @@ jobs:
image: ckb-explorer-frontend
registry: ghcr.io
githubOrg: magickbase # optional
buildArgs: "API_URL=${{ secrets.API_URL }},CHAIN_TYPE=${{ inputs.ckb-mode }}"
buildArgs: 'API_URL=${{ secrets.API_URL }},CHAIN_TYPE=${{ inputs.ckb-mode }}'
enableBuildKit: true
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Update image on K8S
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.KUBOARD_API_URL }}/cluster/ckb/kind/CICDApi/ops/resource/updateImageTag
method: 'PUT'
customHeaders: '{"Content-Type": "application/json", "Cookie": "KuboardUsername=${{ secrets.KUBOARD_USERNAME }}; KuboardAccessKey=${{ secrets.KUBOARD_ACCESS_KEY }}"}'
data: '{"kind":"deployments","namespace":"${{ inputs.k8s-namespace }}","name":"${{ inputs.k8s-workload }}","images":{"ckb-explorer-frontend":"${{ steps.docker_build.outputs.imageFullName }}:${{ steps.docker_build.outputs.tags }}"}}'
- name: Restart container
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.KUBOARD_API_URL }}/cluster/ckb/kind/CICDApi/ops/resource/restartWorkload
method: 'PUT'
customHeaders: '{"Content-Type": "application/json", "Cookie": "KuboardUsername=${{ secrets.KUBOARD_USERNAME }}; KuboardAccessKey=${{ secrets.KUBOARD_ACCESS_KEY }}"}'
data: '{"kind":"deployments","namespace":"${{ inputs.k8s-namespace }}","name":"${{ inputs.k8s-workload }}"}'


# - name: Update image on K8S
# uses: fjogeleit/http-request-action@v1
# with:
# url: ${{ secrets.KUBOARD_API_URL }}/cluster/ckb/kind/CICDApi/ops/resource/updateImageTag
# method: 'PUT'
# customHeaders: '{"Content-Type": "application/json", "Cookie": "KuboardUsername=${{ secrets.KUBOARD_USERNAME }}; KuboardAccessKey=${{ secrets.KUBOARD_ACCESS_KEY }}"}'
# data: '{"kind":"deployments","namespace":"${{ inputs.k8s-namespace }}","name":"${{ inputs.k8s-workload }}","images":{"ckb-explorer-frontend":"${{ steps.docker_build.outputs.imageFullName }}:${{ steps.docker_build.outputs.tags }}"}}'
# - name: Restart container
# uses: fjogeleit/http-request-action@v1
# with:
# url: ${{ secrets.KUBOARD_API_URL }}/cluster/ckb/kind/CICDApi/ops/resource/restartWorkload
# method: 'PUT'
# customHeaders: '{"Content-Type": "application/json", "Cookie": "KuboardUsername=${{ secrets.KUBOARD_USERNAME }}; KuboardAccessKey=${{ secrets.KUBOARD_ACCESS_KEY }}"}'
# data: '{"kind":"deployments","namespace":"${{ inputs.k8s-namespace }}","name":"${{ inputs.k8s-workload }}"}'

0 comments on commit 6aebc1b

Please sign in to comment.