mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 15:26:33 +00:00
chore(workflow): refactor Docker build and push workflow with matrix strategy
This commit is contained in:
parent
c29e62b1e0
commit
bb06fafe78
35
.github/workflows/docker-build-and-push.yml
vendored
35
.github/workflows/docker-build-and-push.yml
vendored
@ -8,6 +8,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
docker-build-and-push:
|
docker-build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image: [monaco-editor-lsp-next, lsp-c, lsp-cpp]
|
||||||
|
context: [., ./docker/lsp/clangd, ./docker/lsp/clangd]
|
||||||
|
file: [Dockerfile, ./docker/lsp/clangd/Dockerfile, ./docker/lsp/clangd/Dockerfile]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -21,34 +26,16 @@ jobs:
|
|||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
platforms: amd64,arm64
|
platforms: amd64
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and push monaco-editor-lsp-next
|
- name: Build and push ${{ matrix.image }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: ${{ matrix.context }}
|
||||||
file: Dockerfile
|
file: ${{ matrix.file }}
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.DOCKERHUB_USERNAME }}/monaco-editor-lsp-next:latest
|
tags: ${{ vars.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64
|
||||||
|
|
||||||
- name: Build and push lsp-c
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./docker/lsp/clangd
|
|
||||||
file: Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: ${{ vars.DOCKERHUB_USERNAME }}/lsp-c:latest
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
- name: Build and push lsp-cpp
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./docker/lsp/clangd
|
|
||||||
file: Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: ${{ vars.DOCKERHUB_USERNAME }}/lsp-cpp:latest
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
Loading…
Reference in New Issue
Block a user