Skip to content

🐛fonts cdn load error #67

🐛fonts cdn load error

🐛fonts cdn load error #67

name: Nightly Docker Build
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
setup:
if: contains('["libsgh"]', github.actor)
name: build setup
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.setup.outputs.branch }}
target: ${{ steps.setup.outputs.target }}
image_name: "iicm/pan-index:dev"
steps:
- name: setup
id: setup
run: |
target='["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/386", "linux/arm/v7", "linux/arm/v6"]'
branch='["dev"]'
list=$(echo ${target} | jq -c)
echo "target=${list}" >> $GITHUB_OUTPUT
b=$(echo ${branch} | jq -c)
echo "branch=${b}" >> $GITHUB_OUTPUT
build:
if: contains('["libsgh"]', github.actor)
needs: setup
strategy:
matrix:
target: ${{ fromJson(needs.setup.outputs.target) }}
branch: ${{ fromJson(needs.setup.outputs.branch) }}
go-version: [1.20.1]
name: build
runs-on: ubuntu-latest
outputs:
artifact_name: ${{ steps.artifact.outputs.name }}
steps:
- name: Setup Artifact Name
id: artifact
run: |
tar=${{ matrix.target }}
a=${tar//'/'/'-'}
echo "name=${a}" >> $GITHUB_OUTPUT
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ matrix.branch }}
fetch-depth: 0
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ needs.setup.outputs.image_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ steps.artifact.outputs.name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ steps.artifact.outputs.name }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: iicm
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
provenance: false
sbom: false
build-args: |
GO_VERSION=${{ matrix.go-version }}
VERSION=${{ github.ref }}
TYPE=nightly_build_docker
APP_NAME=PanIndex
tags: iicm/pan-index:dev-${{ steps.artifact.outputs.name }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.target }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
combine:
if: contains('["libsgh"]', github.actor)
runs-on: ubuntu-latest
needs:
- setup
- build
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: iicm
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Combine images
run: |
args=""
remove_tags=""
for target in ${{ join(fromJson(needs.setup.outputs.target), ' ') }}
do
name=${target//'/'/'-'}
remove_tags="$remove_tags ${{ needs.setup.outputs.image_name }}-$name"
args="$args --amend ${{ needs.setup.outputs.image_name }}-$name"
done
docker manifest create ${{ needs.setup.outputs.image_name }} ${args}
docker manifest push --purge ${{ needs.setup.outputs.image_name }}
docker run --rm lumir/remove-dockerhub-tag --user iicm \
--password ${{ secrets.DOCKERHUB_PASSWORD }} ${remove_tags}
shell: bash