Skip to content

Commit 46675b7

Browse files
committed
feat: update build arm
1 parent 9e57857 commit 46675b7

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.github/workflows/build-arm.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "Build dev container"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
list-dir:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
dir: ${{ steps.list-dir.outputs.dir }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: List Dir
27+
id: list-dir
28+
uses: pnstack/actions/list-dir@main
29+
with:
30+
dir: templates-arm
31+
32+
- name: log
33+
run: echo ${{ steps.list-dir.outputs.dir }}
34+
35+
build:
36+
runs-on: ubuntu-latest
37+
needs: [list-dir]
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
dir: ${{fromJson(needs.list-dir.outputs.dir)}}
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Set up QEMU
47+
uses: docker/setup-qemu-action@v3
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
with:
52+
use: true
53+
54+
- name: Log in to the Container registry
55+
uses: docker/[email protected]
56+
with:
57+
registry: ${{ env.REGISTRY }}
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Extract metadata (tags, labels) for Docker
62+
id: meta
63+
uses: docker/metadata-action@v5
64+
with:
65+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
66+
67+
- name: Build and run Dev Container task
68+
uses: devcontainers/[email protected]
69+
with:
70+
subFolder: ./templates-arm/${{ matrix.dir }}
71+
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}-arm
72+
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
73+
imageTag: ${{ github.ref == 'refs/heads/main' && 'latest' || steps.meta.outputs.tags }}
74+
platform: linux/arm64
75+
push: always
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
7+
"runArgs": ["--device=/dev/net/tun"],
8+
"features": {},
9+
10+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
11+
// "forwardPorts": [],
12+
13+
// Use 'postCreateCommand' to run commands after the container is created.
14+
// "postCreateCommand": "uname -a",
15+
16+
// Configure tool-specific properties.
17+
// "customizations": {},
18+
19+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
20+
"remoteUser": "root"
21+
}

0 commit comments

Comments
 (0)