|
@@ -106,10 +106,6 @@ jobs:
|
|
|
- name: Checkout
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
- - name: Get the version
|
|
|
- id: get_version
|
|
|
- run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
|
|
-
|
|
|
- name: Set up Go
|
|
|
uses: actions/setup-go@v3
|
|
|
with:
|
|
@@ -131,10 +127,12 @@ jobs:
|
|
|
export _NAME=nginx-ui-$(jq ".$GOOS[\"$GOARCH$GOARM\"].name" -r < .github/build/build_info.json)
|
|
|
export _ARCH=$(jq ".$GOOS[\"$GOARCH$GOARM\"].arch" -r < .github/build/build_info.json)
|
|
|
export _ABI=$(jq ".$GOOS[\"$GOARCH$GOARM\"].abi // \"\"" -r < .github/build/build_info.json)
|
|
|
- echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, ABI: $_ABI, RELEASE_NAME: $_NAME"
|
|
|
+ export _ARTIFACT=nginx-ui-$GOOS-$GOARCH$(if [[ "$GOARM" ]]; then echo "v$GOARM"; fi)
|
|
|
+ echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, ABI: $_ABI, RELEASE_NAME: $_NAME, ARTIFACT_NAME: $_ARTIFACT"
|
|
|
echo "ARCH_NAME=$_ARCH" >> $GITHUB_ENV
|
|
|
echo "ABI=$_ABI" >> $GITHUB_ENV
|
|
|
echo "DIST=$_NAME" >> $GITHUB_ENV
|
|
|
+ echo "ARTIFACT=$_ARTIFACT" >> $GITHUB_ENV
|
|
|
|
|
|
- name: Install musl cross compiler
|
|
|
if: env.GOOS == 'linux'
|
|
@@ -176,7 +174,7 @@ jobs:
|
|
|
- name: Archive backend artifacts
|
|
|
uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
- name: ${{ env.DIST }}
|
|
|
+ name: ${{ env.ARTIFACT }}
|
|
|
path: dist/nginx-ui
|
|
|
|
|
|
- name: Prepare publish
|
|
@@ -191,49 +189,66 @@ jobs:
|
|
|
with:
|
|
|
files: ${{ env.DIST }}.tar.gz
|
|
|
|
|
|
+ docker-build:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: build
|
|
|
+ env:
|
|
|
+ PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/arm/v5
|
|
|
+ steps:
|
|
|
+ - name: Checkout
|
|
|
+ uses: actions/checkout@v3
|
|
|
+
|
|
|
+ - name: Get the version
|
|
|
+ id: get_version
|
|
|
+ run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
|
|
+
|
|
|
+ - name: Download artifacts
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
+ with:
|
|
|
+ path: ./dist
|
|
|
+
|
|
|
+ - name: Prepare Artifacts
|
|
|
+ run: chmod +x ./dist/nginx-ui-*/nginx-ui
|
|
|
+
|
|
|
- name: Set up Docker Buildx
|
|
|
- if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
id: buildx
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
- if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
uses: docker/login-action@v2
|
|
|
with:
|
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
- name: Prepare Dockerfile
|
|
|
- if: github.event_name == 'release' && env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
+ if: github.event_name == 'release'
|
|
|
run: |
|
|
|
cp ./Dockerfile ./dist
|
|
|
cp -rp ./resources ./dist
|
|
|
|
|
|
- name: Build and push
|
|
|
- if: github.event_name == 'release' && env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
+ if: github.event_name == 'release'
|
|
|
uses: docker/build-push-action@v3
|
|
|
with:
|
|
|
context: ./dist
|
|
|
file: ./dist/Dockerfile
|
|
|
- platforms: linux/amd64
|
|
|
+ platforms: ${{ env.PLATFORMS }}
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
tags: |
|
|
|
uozi/nginx-ui:latest
|
|
|
uozi/nginx-ui:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
|
|
- name: Prepare Demo Dockerfile
|
|
|
- if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
run: |
|
|
|
cp ./demo.Dockerfile ./dist
|
|
|
cp -rp ./resources ./dist
|
|
|
|
|
|
- name: Build and push demo
|
|
|
- if: env.GOOS == 'linux' && env.GOARCH == 'amd64'
|
|
|
uses: docker/build-push-action@v3
|
|
|
with:
|
|
|
context: ./dist
|
|
|
file: ./dist/demo.Dockerfile
|
|
|
- platforms: linux/amd64
|
|
|
+ platforms: ${{ env.PLATFORMS }}
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
tags: |
|
|
|
uozi/nginx-ui-demo:latest
|