2023-03-24 01:54:51 +08:00
|
|
|
name: docker-release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: corepack enable
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
cache: 'pnpm'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm i
|
|
|
|
|
|
|
|
- name: Run linters
|
|
|
|
run: pnpm lint
|
|
|
|
|
|
|
|
- name: Run unit test
|
|
|
|
run: pnpm test
|
|
|
|
|
|
|
|
- name: Build the app
|
|
|
|
run: pnpm build
|
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- ci
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-03-24 04:48:07 +08:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
2023-03-24 01:54:51 +08:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
2023-03-24 04:48:07 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-03-24 01:54:51 +08:00
|
|
|
push: true
|
|
|
|
tags: corentinth/it-tools:latest
|