Skip to content

Update README.md

Update README.md #29

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 --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="$(LDFLAGS)" -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"