Skip to content

fix: use crypto/rand #66

fix: use crypto/rand

fix: use crypto/rand #66

Workflow file for this run

name: DockerBuild And Deploy
on:
push:
tags:
- "v*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: get image name
run: |
VERSION=${GITHUB_REF#refs/tags/v}
DOCKER_IMAGE_NAME=$(echo "docker.io/mereith/van-nav:v${VERSION}")
DOCKER_IMAGE_NAME_LATEST=$(echo "docker.io/mereith/van-nav:latest")
echo ${VERSION}
echo "::set-output name=DOCKER_IMAGE_NAME::$DOCKER_IMAGE_NAME"
echo "::set-output name=DOCKER_IMAGE_NAME_LATEST::$DOCKER_IMAGE_NAME_LATEST"
id: image-name
- name: Build image And Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.image-name.outputs.DOCKER_IMAGE_NAME }}
${{ steps.image-name.outputs.DOCKER_IMAGE_NAME_LATEST }}
- name: deploy to cluster
uses: steebchen/kubectl@v2.0.0
with: # defaults to latest kubectl binary version
config: ${{ secrets.K8S_CONFIG_DATA }}
command: set image deployment/tools -n self-tools tools=${{ steps.image-name.outputs.DOCKER_IMAGE_NAME }}
- name: deploy to cluster for demo
uses: steebchen/kubectl@v2.0.0
with: # defaults to latest kubectl binary version
config: ${{ secrets.K8S_CONFIG_DATA }}
command: set image deployment/demo-tools -n self-tools demo=${{ steps.image-name.outputs.DOCKER_IMAGE_NAME }}
- name: deploy to cluster for plg
uses: steebchen/kubectl@v2.0.0
with: # defaults to latest kubectl binary version
config: ${{ secrets.K8S_CONFIG_DATA }}
command: set image deployment/plg-tools -n self-tools tool=${{ steps.image-name.outputs.DOCKER_IMAGE_NAME }}
- name: send Message To me
run: |
curl -X POST -H "Content-Type: application/json" -d '{"source":"github-ci:van-nav","message":"流水线运行完毕,k8s, k3s 已部署。\n版本: ${{ github.ref_name }}" }' ${{ secrets.WEBHOOK_URL }}