fix(README) #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-and-push | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build_and_push: | |
| name: Build and push ${{ matrix.context }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - context: bashls | |
| tag: bash-language-server | |
| - context: clangd | |
| tag: clangd-language-server | |
| - context: denols | |
| tag: denols | |
| - context: dockerls | |
| tag: docker-language-server | |
| - context: eslintls | |
| tag: eslint-language-server | |
| - context: gopls | |
| tag: gopls | |
| - context: graphql-lsp | |
| tag: graphql-language-service-cli | |
| - context: html | |
| tag: html-language-server | |
| - context: intelephense | |
| tag: intelephense | |
| - context: jsonls | |
| tag: json-language-server | |
| - context: lemminx | |
| tag: lemminx | |
| - context: omnisharp | |
| tag: omnisharp | |
| - context: powershell_es | |
| tag: powershell-language-server | |
| - context: prisma | |
| tag: prisma-language-server | |
| - context: pylsp | |
| tag: python-lsp-server | |
| - context: pyright | |
| tag: pyright-langserver | |
| - context: rust_analyzer | |
| tag: rust-analyzer | |
| - context: solargraph | |
| tag: solargraph | |
| - context: sumneko_lua | |
| tag: lua-language-server | |
| - context: svelteserver | |
| tag: svelte-language-server | |
| - context: tailwindcss | |
| tag: tailwindcss-language-server | |
| - context: terraformls | |
| tag: terraform-ls | |
| - context: tsserver | |
| tag: typescript-language-server | |
| - context: volar | |
| tag: volar | |
| - context: vuels | |
| tag: vue-language-server | |
| - context: yamlls | |
| tag: yaml-language-server | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| # TODO: Replace w/ Github Action - https://github.com/lspcontainers/dockerfiles/runs/2724936969?check_suite_focus=true#step:4:7 | |
| - name: Run hadolint | |
| run: > | |
| docker container run | |
| --entrypoint hadolint | |
| --rm | |
| --volume $(pwd):/code | |
| --workdir /code | |
| hadolint/hadolint:latest-alpine | |
| servers/${{ matrix.context }}/Dockerfile | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Extract version from Dockerfile | |
| id: version | |
| run: | | |
| VERSION=$(grep "ARG VERSION=" servers/${{ matrix.context }}/Dockerfile | cut -d'=' -f2 || echo "unknown") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| if [ "$VERSION" != "unknown" ]; then | |
| TAGS="lspcontainers/${{ matrix.tag }}:latest,lspcontainers/${{ matrix.tag }}:$VERSION" | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| else | |
| TAGS="lspcontainers/${{ matrix.tag }}:latest" | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| fi | |
| echo "🏷️ Tags that will be used: $TAGS" | |
| # Set platforms based on container compatibility | |
| if [ "${{ matrix.context }}" = "powershell_es" ]; then | |
| echo "platforms=linux/amd64" >> $GITHUB_OUTPUT | |
| echo "🏗️ PowerShell ES: Building for amd64 only (ARM64 not supported by Microsoft PowerShell base image)" | |
| else | |
| echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT | |
| echo "🏗️ Building for platforms: linux/amd64,linux/arm64" | |
| fi | |
| - name: Build and push to Docker Hub | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: servers/${{ matrix.context }} | |
| platforms: ${{ steps.version.outputs.platforms }} | |
| push: ${{ github.ref == 'refs/heads/main' }} | |
| tags: ${{ steps.version.outputs.tags }} |