name: build on: push: branches: [ v2 ] pull_request: branches: [ v2 ] jobs: build: strategy: matrix: platform: [ubuntu-latest] go-version: [1.17] name: Build runs-on: ${{ matrix.platform }} steps: - name: Setup Go uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - name: Set up Node uses: actions/setup-node@v2 with: node-version: '16' - name: Checkout uses: actions/checkout@v2 with: ref: v2 path: alist - name: Set up xgo run: | docker pull techknowlogick/xgo:latest go install src.techknowlogick.com/xgo@latest sudo apt install upx - name: Build run: | mv alist/build.sh . bash build.sh web mv dist/* alist/public bash build.sh build - name: Upload artifact uses: actions/upload-artifact@v2 with: name: artifact path: alist/build docker: name: Docker runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Docker meta id: meta uses: docker/metadata-action@v3 with: images: xhofe/alist - name: Set up Node uses: actions/setup-node@v2 with: node-version: '16' - name: Build web run: | bash build.sh web mv dist/* public - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 with: username: xhofe password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x