Skip to content

v1.16.0

v1.16.0 #48

name: Release Dongtai web
on:
release:
types: [ created, edited ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: start-build
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
body: '{"msg_type": "interactive","card": {"config": {"wide_screen_mode": true,"enable_forward": true},"elements": [{"tag": "div","text": {"content": "状态:构建开始\n项目:${{github.repository}}\n分支:${{github.ref}}\n流程:${{github.workflow}}\n构建编号:${{github.run_number}}\n触发事件:${{github.event_name}}\n提交人:${{github.actor}}\nSHA-1:${{github.sha}}\n","tag": "lark_md"}}]}}'
- name: checkout
uses: actions/checkout@v2
- name: setup nodejs
uses: actions/setup-node@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}
- name: test and build
run: |
npm ci
npm test
npm run build --if-present
- id: release
run: |
TAG_NAME=${{ github.event.release.tag_name }}
ID=`echo ${TAG_NAME##v}`
echo "::set-output name=VERSION::$ID"
- name: Release DongTai-WEB
run: |
bash .github/workflows/scripts/release_version.sh "${{ steps.release.outputs.VERSION }}"
- name: Generate version file
run: |
cd ${{ github.workspace }} && \
echo "${{ github.event.repository.name }},version,${{ steps.release.outputs.VERSION }}" >> dist/version.txt && \
echo "${{ github.event.repository.name }},commit_hash,${GITHUB_SHA}" >> dist/version.txt && \
cat dist/version.txt \
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
dongtai/dongtai-web:${{ steps.release.outputs.VERSION }}
dongtai/dongtai-web:latest
- name: finish build
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
body: '{"msg_type": "interactive","card": {"config": {"wide_screen_mode": true,"enable_forward": true},"elements": [{"tag": "div","text": {"content": "状态:构建开始\n项目:${{github.repository}}\n分支:${{github.ref}}\n流程:${{github.workflow}}\n构建编号:${{github.run_number}}\n触发事件:${{github.event_name}}\n提交人:${{github.actor}}\nSHA-1:${{github.sha}}\n","tag": "lark_md"}}]}}'