Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
samtoxie committed Oct 3, 2024
0 parents commit ca88e97
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Tag Docker Image

on:
push:
branches:
- master

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ${{ vars.FUGA_REGISTRY_FQDN }}
# github.repository as <account>/<repo>
IMAGE: public/actions-runner


jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# Extract the version from the Dockerfile
- name: Set version from Dockerfile
id: set-version
run: |
VERSION=$(grep -oP '^FROM ghcr.io/actions/actions-runner:\K[^\s]+' Dockerfile)
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Log into Docker (optional, only needed if pushing to a registry)
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.FUGA_REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u ${{ secrets.FUGA_REGISTRY_USERNAME }} --password-stdin

# Build the Docker image
- name: Build Docker image
run: docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.VERSION }} .

# Push the Docker image
- name: Push Docker image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.VERSION }}

# Install Cosign (for signing)
- name: Install Cosign
run: |
curl -LO https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64
chmod +x cosign-linux-amd64
sudo mv cosign-linux-amd64 /usr/local/bin/cosign
# Sign the Docker image using GitHub OIDC
- name: Sign Docker image
run: |
cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.VERSION }} \
--identity-token "${{ secrets.GITHUB_TOKEN }}"
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ghcr.io/actions/actions-runner:2.319.1

RUN sudo apt update -y && \
sudo apt install -y \
curl
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fuga Cloud `actions-runner` images

This repo extends the default images to support common tools such as curl.

0 comments on commit ca88e97

Please sign in to comment.