-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add build-dev-container workflow and Ubuntu devcontainer
- Added a new workflow file `build-dev-container.yaml` to build the development container. - Created a new devcontainer configuration file `devcontainer.json` for Ubuntu. - The workflow sets up a matrix based on subfolders in the templates directory. - The build step now uses the subfolder from the matrix to specify the template and image name. This commit adds support for building the development container and includes an initial configuration for Ubuntu.
- Loading branch information
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,28 @@ on: # rebuild any PRs and main branch changes | |
- master | ||
|
||
jobs: | ||
build: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set matrix for build | ||
id: set-matrix | ||
run: | | ||
FOLDERS=$(ls -d templates/*/) | ||
FOLDERS=${FOLDERS//\//} # remove trailing slashes | ||
FOLDERS=${FOLDERS//templates\//} # remove leading 'templates/' | ||
FOLDERS_JSON=$(echo "$FOLDERS" | jq -R -s -c 'split("\n")[:-1]') | ||
echo "::set-output name=matrix::${FOLDERS_JSON}" | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
subfolder: ${{fromJson(needs.prepare.outputs.matrix)}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -29,7 +47,7 @@ jobs: | |
- name: Build and run Dev Container task | ||
uses: devcontainers/[email protected] | ||
with: | ||
subFolder: ./templates/react-native | ||
imageName: ghcr.io/pnstack/codespace/react-native | ||
subFolder: ./templates/${{ matrix.subfolder }} | ||
imageName: ghcr.io/pnstack/codespace/${{ matrix.subfolder }} | ||
platform: linux/amd64,linux/arm64 | ||
push: always |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
"runArgs": ["--device=/dev/net/tun"], | ||
"features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root" | ||
} |