Skip to content

Commit

Permalink
Merge pull request #4 from rails/publish-images
Browse files Browse the repository at this point in the history
Basic workflow for prebuilding images
  • Loading branch information
andrewn617 authored Mar 12, 2024
2 parents 09fa32a + f4c0059 commit b4a3bba
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-and-publish-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Publish Images

on:
workflow_dispatch:

jobs:
build:
name: Build Images

strategy:
fail-fast: false
matrix:
RUBY_VERSION:
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0

runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pre-build Dev Container Image
uses: devcontainers/[email protected]
env:
RUBY_VERSION: ${{ matrix.RUBY_VERSION }}
with:
imageName: ghcr.io/rails/devcontainer/images/ruby
cacheFrom: ghcr.io/rails/devcontainer/images/ruby
imageTag: 0.1.0-${{ matrix.RUBY_VERSION }}
subFolder: images/ruby
push: always
5 changes: 5 additions & 0 deletions images/ruby/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/devcontainers/base:1-bookworm

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
&& apt-get purge -y imagemagick imagemagick-6-common
24 changes: 24 additions & 0 deletions images/ruby/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/rails/devcontainer/features/ruby:0.1.0": {
"version": "${localEnv:RUBY_VERSION}"
}
},
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

0 comments on commit b4a3bba

Please sign in to comment.