Skip to content

Dev 1.4.0

Dev 1.4.0 #117

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
paths-ignore:
- .github/**
- docs/**
pull_request:
branches: [ main ]
env:
IMAGE_NAME: registry.ap-southeast-1.aliyuncs.com/kuops/easy-admin # docker image
TAG: ${{ secrets.IMAGE_NAME_TAG }}
IMAGE_NAME_TAG: registry.ap-southeast-1.aliyuncs.com/kuops/easy-admin:${{ secrets.IMAGE_NAME_TAG }}
jobs:
sync:
name: 'Submodules Sync'
runs-on: ubuntu-latest
steps:
- name: check submodules
uses: actions/checkout@v4
with:
submodules: true
# Update references
- name: Git Sumbodule Update
run: |
git submodule update --remote --recursive
- name: ls dir
run: ls -la
- name: cd ui
run: cd ./ui/ && ls -la
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21']
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Git Sumbodule Update
run: |
git submodule update --remote --recursive
- name: npm install
run: cd ./ui/ && npm install --legacy-peer-deps
- name : npm build
run: cd ./ui/ && npm run build:prod:base --legacy-peer-deps
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
# - name: go Test
# run: go test
- name: Tidy
run: go mod tidy
- name: Build
run: CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix "" -o easy-admin .
- name: Build the Docker image and push
run: |
docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-southeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }}
echo "************ docker login end"
docker build -t easy-admin:latest .
echo "************ docker build end"
docker tag easy-admin ${{ env.IMAGE_NAME_TAG }}
echo "************ docker tag end"
docker images
echo "************ docker images end"
docker push ${{ env.IMAGE_NAME_TAG }} # 推送
echo "************ docker push end"
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.HUB_DOCKER_USERNAME }}
password: ${{ secrets.HUB_DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: nicesteven/easy-admin
- name: Build and push Docker image version
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: nicesteven/easy-admin:1.4.0
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: nicesteven/easy-admin:latest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}