diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..f8370b2 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,49 @@ +name: Build and Push + +on: + push: + branches: + - master + +jobs: + build: + strategy: + fail-fast: false + matrix: + target: + - name: with rootfs + image-name: menci/syzoj-judge + dockerfile: Dockerfile + - name: without rootfs + image-name: menci/syzoj-judge-norootfs + dockerfile: Dockerfile.NOROOTFS + name: Build and Push (${{ matrix.target.name }}) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Generate Tag List + run: | + echo "TAGS<> $GITHUB_ENV + + HASH_SHORT="$(git rev-parse --short HEAD)" + echo $IMAGE_NAME:$HASH_SHORT >> $GITHUB_ENV + echo $IMAGE_NAME:latest >> $GITHUB_ENV + + echo "EOF" >> $GITHUB_ENV + env: + IMAGE_NAME: ${{ matrix.target.image-name }} + - name: Build and Push + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64 + push: true + tags: ${{ env.TAGS }} + file: ${{ matrix.target.dockerfile }} diff --git a/package.json b/package.json index 3b78beb..176bc44 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "command-line-args": "^4.0.7", "cors": "^2.8.4", "crypto-js": "^3.1.9-1", - "decompress": "^4.2.0", + "decompress": "^4.2.1", "express": "^4.15.4", "fs-extra": "^3.0.1", "get-folder-size": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 26853b0..dd8399b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -846,10 +846,10 @@ decompress-unzip@^4.0.1: pify "^2.3.0" yauzl "^2.4.2" -decompress@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" - integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= +decompress@^4.2.1: + version "4.2.1" + resolved "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" + integrity sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ== dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0"