fork/static-web-server
git clone https://git.julia.blue/fork/static-web-server
1c4929d
allow-symlink
1name : devel-docker 2on : 3merge_group : 4branches : 5- master 6pull_request : 7paths : 8- docker/**/Dockerfile 9- scripts/ci/**/*.sh 10- .github/workflows/devel.docker.yml 11push : 12branches : 13- master 14paths : 15- docker/**/Dockerfile 16- scripts/ci/**/*.sh 17- .github/workflows/devel.docker.yml 18 19env : 20DOCKER_IMAGE : localhost:5000/github.com/static-web-server/static-web-server 21 22jobs : 23docker-alpine : 24name : Docker test (alpine) 25strategy : 26matrix : 27arch : 28- linux/amd64 29- linux/386 30- linux/arm64 31- linux/arm/v7 32- linux/arm/v6 33runs-on : ubuntu-22.04 34services : 35registry : 36image : registry:2 37ports : 38- 5000:5000 39steps : 40- 41name : Dependencies 42run : | 43sudo apt-get install jq 44- 45name : Checkout 46uses : actions/checkout@v4 47with : 48fetch-depth : 1 49- 50name : Cache Docker layers 51uses : actions/cache@v4 52with : 53path : /tmp/.buildx-cache 54key : static-web-server-${{ matrix.arch }}-alpine-buildx-${{ github.sha }} 55restore-keys : | 56static-web-server-${{ matrix.arch }}-alpine-buildx- 57- 58name : Set up QEMU 59uses : docker/setup-qemu-action@v3 60- 61name : Docker meta alpine 62id : meta_alpine 63uses : docker/metadata-action@v5 64with : 65images : ${{ env.DOCKER_IMAGE }} 66flavor : | 67latest=false 68suffix=-alpine 69tags : | 70type=schedule 71type=ref,event=branch 72type=ref,event=pr 73type=semver,pattern={{version}} 74type=semver,pattern={{major}}.{{minor}} 75type=semver,pattern={{major}} 76type=sha 77- 78name : Set up Docker Buildx 79uses : docker/setup-buildx-action@v3 80with : 81driver-opts : network=host 82- 83name : Prepare Docker envs 84shell : bash 85env : 86GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 87run : | 88scripts/ci/get_latest_release.sh 89cat /tmp/version >> $GITHUB_ENV 90cat /tmp/version 91echo "SERVER_DOCKERFILE=./docker/alpine/Dockerfile" >> $GITHUB_ENV 92- 93name : Build and export to Docker client 94uses : docker/build-push-action@v6 95with : 96context : . 97platforms : ${{ matrix.arch }} 98file : ${{ env.SERVER_DOCKERFILE }} 99load : true 100tags : ${{ steps.meta_alpine.outputs.tags }} 101labels : ${{ steps.meta_alpine.outputs.labels }} 102build-args : | 103SERVER_VERSION=${{ env.SERVER_VERSION }} 104- 105name : Build and push to local registry 106uses : docker/build-push-action@v6 107with : 108context : . 109platforms : ${{ matrix.arch }} 110file : ${{ env.SERVER_DOCKERFILE }} 111push : ${{ github.event_name != 'pull_request' }} 112tags : ${{ steps.meta_alpine.outputs.tags }} 113labels : ${{ steps.meta_alpine.outputs.labels }} 114build-args : | 115SERVER_VERSION=${{ env.SERVER_VERSION }} 116cache-from : type=local,src=/tmp/.buildx-cache 117cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max 118- 119name : Inspect image 120run : | 121docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta_alpine.outputs.version }} 122- 123name : Check manifest 124if : github.event_name != 'pull_request' 125run : | 126docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta_alpine.outputs.version }} 127- 128# Temp fix 129# https://github.com/docker/build-push-action/issues/252 130# https://github.com/moby/buildkit/issues/1896 131name : Move cache 132run : | 133rm -rf /tmp/.buildx-cache 134mv /tmp/.buildx-cache-new /tmp/.buildx-cache 135 136docker-debian : 137name : Docker test (debian) 138strategy : 139matrix : 140arch : 141- linux/amd64 142- linux/386 143- linux/arm64 144- linux/arm/v7 145- linux/arm/v6 146- linux/ppc64le 147- linux/s390x 148runs-on : ubuntu-22.04 149services : 150registry : 151image : registry:2 152ports : 153- 5000:5000 154steps : 155- 156name : Dependencies 157run : | 158sudo apt-get install jq 159- 160name : Checkout 161uses : actions/checkout@v4 162with : 163fetch-depth : 1 164- 165name : Cache Docker layers 166uses : actions/cache@v4 167with : 168path : /tmp/.buildx-cache 169key : static-web-server-${{ matrix.arch }}-debian-buildx-${{ github.sha }} 170restore-keys : | 171static-web-server-${{ matrix.arch }}-debian-buildx- 172- 173name : Set up QEMU 174uses : docker/setup-qemu-action@v3 175- 176name : Docker meta debian 177id : meta_debian 178uses : docker/metadata-action@v5 179with : 180images : ${{ env.DOCKER_IMAGE }} 181flavor : | 182latest=false 183suffix=-debian 184tags : | 185type=schedule 186type=ref,event=branch 187type=ref,event=pr 188type=semver,pattern={{version}} 189type=semver,pattern={{major}}.{{minor}} 190type=semver,pattern={{major}} 191type=sha 192- 193name : Set up Docker Buildx 194uses : docker/setup-buildx-action@v3 195with : 196driver-opts : network=host 197- 198name : Prepare Docker envs 199shell : bash 200env : 201GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 202run : | 203scripts/ci/get_latest_release.sh 204cat /tmp/version >> $GITHUB_ENV 205cat /tmp/version 206echo "SERVER_DOCKERFILE=./docker/debian/Dockerfile" >> $GITHUB_ENV 207- 208name : Build and export to Docker client 209uses : docker/build-push-action@v6 210with : 211context : . 212platforms : ${{ matrix.arch }} 213file : ${{ env.SERVER_DOCKERFILE }} 214load : true 215tags : ${{ steps.meta_debian.outputs.tags }} 216labels : ${{ steps.meta_debian.outputs.labels }} 217build-args : | 218SERVER_VERSION=${{ env.SERVER_VERSION }} 219- 220name : Build and push to local registry 221uses : docker/build-push-action@v6 222with : 223context : . 224platforms : ${{ matrix.arch }} 225file : ${{ env.SERVER_DOCKERFILE }} 226push : ${{ github.event_name != 'pull_request' }} 227tags : ${{ steps.meta_debian.outputs.tags }} 228labels : ${{ steps.meta_debian.outputs.labels }} 229build-args : | 230SERVER_VERSION=${{ env.SERVER_VERSION }} 231cache-from : type=local,src=/tmp/.buildx-cache 232cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max 233- 234name : Inspect image 235run : | 236docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta_debian.outputs.version }} 237- 238name : Check manifest 239if : github.event_name != 'pull_request' 240run : | 241docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta_debian.outputs.version }} 242- 243# Temp fix 244# https://github.com/docker/build-push-action/issues/252 245# https://github.com/moby/buildkit/issues/1896 246name : Move cache 247run : | 248 rm -rf /tmp/.buildx-cache 249 mv /tmp/.buildx-cache-new /tmp/.buildx-cache