70 lines
2.5 KiB
YAML
70 lines
2.5 KiB
YAML
name: Docker next-terminal Build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
DOCKERHUB_next-terminal_Build:
|
|
name: Docker next-terminal Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get version
|
|
id: get_version
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
|
- name: Private Actions Checkout
|
|
uses: actions/checkout@v2.3.4
|
|
- name: Docker Setup QEMU
|
|
uses: docker/setup-qemu-action@v1.2.0
|
|
- name: Docker Setup Buildx
|
|
uses: docker/setup-buildx-action@v1.6.0
|
|
- name: node Setup
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '14'
|
|
- name: npm install
|
|
run: |
|
|
cd web
|
|
npm install
|
|
npm run build
|
|
- name: Docker Login
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
- name: Docker Aliyun Login
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
registry: registry.cn-beijing.aliyuncs.com
|
|
username: ${{ secrets.ALI_USERNAME }}
|
|
password: ${{ secrets.ALI_PASSWORD }}
|
|
- name: Build and push Docker images
|
|
uses: docker/build-push-action@v2.7.0
|
|
with:
|
|
context: .
|
|
platforms: linux/arm64,linux/arm/v7,linux/amd64
|
|
file: Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:latest
|
|
${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:${{ steps.get_version.outputs.VERSION }}
|
|
registry.cn-beijing.aliyuncs.com/${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:latest
|
|
registry.cn-beijing.aliyuncs.com/${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:${{ steps.get_version.outputs.VERSION }}
|
|
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:cache
|
|
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:cache,mode=max
|
|
|
|
DOCKERHUB_Hub_Description:
|
|
needs: [ DOCKERHUB_next-terminal_Build ]
|
|
name: Change DockerHub Description
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Private Actions Checkout
|
|
uses: actions/checkout@v2.3.4
|
|
- name: Docker Hub Description
|
|
uses: peter-evans/dockerhub-description@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
repository: ${{ secrets.DOCKERHUB_USERNAME }}/next-terminal
|