-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.github |
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,43 @@ | ||
name: Create and publish Docker runner image | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push0image: | ||
runs-on: runner-set-dind | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,42 @@ | ||
FROM ghcr.io/actions/actions-runner:latest | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG ZIG_VERSION=0.11.0 | ||
ARG CARGO_LAMBDA_VERSION=1.0.3 | ||
|
||
# Install base packages | ||
RUN sudo apt update -y \ | ||
&& sudo apt install -y curl wget tar xz-utils unzip build-essential | ||
|
||
# Install GH CLI | ||
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
&& sudo apt update && sudo apt install -y gh | ||
|
||
# Install Rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y | ||
ENV PATH="/home/runner/.cargo/bin:${PATH}" | ||
|
||
RUN rustup target add aarch64-unknown-linux-musl \ | ||
&& rustup toolchain add nightly | ||
|
||
RUN cargo install --locked cargo-lambda@${CARGO_LAMBDA_VERSION} | ||
|
||
# Install Zig | ||
RUN export RUNNER_ARCH=${TARGETARCH} \ | ||
&& if [ "$RUNNER_ARCH" = "arm64" ]; then export RUNNER_ARCH=aarch64 ; fi \ | ||
&& if [ "$RUNNER_ARCH" = "amd64" ]; then export RUNNER_ARCH=x86_64 ; fi \ | ||
&& curl -f -L -o zig.tar.xz https://ziglang.org/download/${ZIG_VERSION}/zig-${TARGETOS}-${RUNNER_ARCH}-${ZIG_VERSION}.tar.xz \ | ||
&& tar xf zig.tar.xz \ | ||
&& rm zig.tar.xz \ | ||
&& mv zig-${TARGETOS}-${RUNNER_ARCH}-${ZIG_VERSION} zig-${ZIG_VERSION} | ||
|
||
ENV PATH="/home/runner/zig-${ZIG_VERSION}:${PATH}" | ||
|
||
# Install Node v20 and AWS CDK | ||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - \ | ||
&& sudo apt-get install -y nodejs \ | ||
&& sudo npm i -g aws-cdk | ||
|
||
RUN sudo rm -rf /var/lib/apt/lists/* |