From 84c479e0c048749bffa4d4e002cf75eda980dc7e Mon Sep 17 00:00:00 2001 From: xychen Date: Tue, 23 Jan 2024 15:09:03 +0800 Subject: [PATCH] Build devcontainer --- .devcontainer.json | 5 ++++ .github/workflows/build-devcontainer.yml | 36 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .devcontainer.json create mode 100644 .github/workflows/build-devcontainer.yml diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..a428679 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,5 @@ +{ + "build": { + "dockerfile": "Dockerfile" + } +} diff --git a/.github/workflows/build-devcontainer.yml b/.github/workflows/build-devcontainer.yml new file mode 100644 index 0000000..4756371 --- /dev/null +++ b/.github/workflows/build-devcontainer.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [ master ] + +concurrency: + group: build-devcontainer + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + registry: + - registry.cn-hangzhou.aliyuncs.com + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + registry: ${{ matrix.registry }} + username: ${{ secrets.ACR_USERNAME }} + password: ${{ secrets.ACR_PASSWORD }} + + - name: Build dev container image + uses: devcontainers/ci@v0.3 + with: + imageTag: latest,2021.7 + imageName: ${{ matrix.registry }}/xingrz/devcontainer-hifi4 + cacheFrom: ${{ matrix.registry }}/xingrz/devcontainer-hifi4 + platform: linux/amd64 + push: always