From 6f7292cb408664375c695cbe98faa73bdfa47533 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 3 May 2023 12:59:44 -0400 Subject: [PATCH] ci: add docker building on merge to main or workflow changes --- .github/workflows/scip-docker.yml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/scip-docker.yml diff --git a/.github/workflows/scip-docker.yml b/.github/workflows/scip-docker.yml new file mode 100644 index 000000000..ea0687864 --- /dev/null +++ b/.github/workflows/scip-docker.yml @@ -0,0 +1,47 @@ +name: docker-scip + +on: + push: + branches: + - scip + pull_request: + paths: + - '.github/workflows/**' + - 'Dockerfile.autoindex' + +jobs: + release-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install asdf. + uses: asdf-vm/actions/setup@v2.1.0 + - name: Cache asdf and asdf-managed tools. + uses: actions/cache@v3.3.1 + id: asdf-cache + with: + path: ${{ env.ASDF_DIR }} + key: asdf-${{ runner.os}}-${{ hashFiles('**/.tool-versions') }} + - name: Install asdf tools (if not cached). + if: steps.asdf-cache.outputs.cache-hit != 'true' + uses: asdf-vm/actions/install@v2.1.0 + - name: Get npm cache directory + id: npm-cache + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT + - uses: actions/cache@v2 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm install + - run: cd ./packages/pyright-scip/ && npm install && npm run build + - uses: docker/setup-buildx-action@v1 + - name: Build Dockerfile + id: docker_build_autoindex + uses: docker/build-push-action@v2 + with: + file: Dockerfile.autoindex + push: false + tags: | + sourcegraph/scip-python:test