-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: colocate custom runner dockerfiles next to manifests
- Loading branch information
1 parent
dead59c
commit dead499
Showing
3 changed files
with
89 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,68 @@ | ||
name: Build Actions Runner Images | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- apps/actions-runner-controller/runners/** | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build-matrix: | ||
name: Build Matrix | ||
runs-on: self-hosted | ||
outputs: | ||
contexts: ${{ steps.find-dockerfiles.outputs.contexts }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Find all Dockerfiles to build | ||
id: find-dockerfiles | ||
run: | | ||
CONTEXTS=$(find apps/actions-runner-controller/runners \ | ||
-name Dockerfile -printf '%h\n' | \ | ||
jq -R -s -c 'split("\n")[:-1]') | ||
echo "contexts=${CONTEXTS}" >> "${GITHUB_OUTPUT}" | ||
build-image: | ||
name: Build Image | ||
runs-on: self-hosted | ||
needs: | ||
- build-matrix | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
matrix: | ||
context: ${{ fromJSON(needs.build-matrix.outputs.contexts) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build image name | ||
id: image-name | ||
env: | ||
context: ${{ matrix.context }} | ||
run: | | ||
echo "name=${context#apps/actions-runner-controller/runners/}" >> "${GITHUB_OUTPUT}" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Docker login | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.context }} | ||
push: true | ||
tags: ${{ env.REGISTRY }}/invakid404/runners/${{ steps.image-name.outputs.name }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,4 @@ | ||
FROM summerwind/actions-runner:latest | ||
|
||
COPY install-deps.sh . | ||
RUN ./install-deps.sh |
17 changes: 17 additions & 0 deletions
17
apps/actions-runner-controller/runners/abcccid/install-deps.sh
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,17 @@ | ||
sudo add-apt-repository ppa:mozillateam/ppa | ||
echo ' | ||
Package: * | ||
Pin: release o=LP-PPA-mozillateam | ||
Pin-Priority: 1001 | ||
' | sudo tee /etc/apt/preferences.d/mozilla-firefox | ||
|
||
sudo apt update | ||
sudo apt install -y jq firefox | ||
|
||
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest) | ||
url=$(printf "%s" "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64") and endswith("gz"))') | ||
curl -s -L "$url" | sudo tar -xz | ||
sudo chmod +x geckodriver | ||
sudo mv geckodriver /usr/bin/ | ||
|
||
ls -la /usr/bin/geckodriver |