Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributing some changes back #11

Merged
merged 6 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build_release:
permissions: write-all
name: "Build and Release"
strategy:
matrix:
RUBY_VERSION: [2.7.3]
NODE_MAJOR_VERSION: [16, 18]
GITHUB_PAGES_VERSION: [226]
VERSIONS: [ {ruby: 2.7.3, ghpages: 226}, {ruby: 2.7.4, ghpages: 228}]
NODE_MAJOR_VERSION: [16,18,20]
runs-on: ubuntu-latest
env:
RUBY_VERSION: ${{ matrix.RUBY_VERSION }}
RUBY_VERSION: ${{ matrix.VERSIONS.ruby }}
NODE_MAJOR_VERSION: ${{ matrix.NODE_MAJOR_VERSION }}
GITHUB_PAGES_VERSION: ${{ matrix.GITHUB_PAGES_VERSION }}
GITHUB_PAGES_VERSION: ${{ matrix.VERSIONS.ghpages }}

steps:
- name: Lowercase repo for IMAGE_NAME
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${REGISTRY}/${IMAGE_NAME}:ruby${RUBY_VERSION}-node${NODE_MAJOR_VERSION} --build-arg RUBY_VERSION=${RUBY_VERSION} --build-arg NODE_MAJOR_VERSION=${NODE_MAJOR_VERSION} --build-arg BUILD_DATE=$(date -u +%Y-%m-%d_%H-%M-%S) --build-arg VCS_REF=${GITHUB_SHA} --build-arg GH_PAGES_VERSION=${GITHUB_PAGES_VERSION} --progress=plain
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Adapted from https://github.com/timbru31/docker-ruby-node/blob/master/2.7/16/Dockerfile
# Using dependency references from https://pages.github.com/versions/

# 2.7.3 is GitHub Pages 226 compatible
ARG RUBY_VERSION=2.7.3
# 2.7.4 is GitHub Pages 228 compatible
ARG RUBY_VERSION=2.7.4

FROM ruby:${RUBY_VERSION}

# NOTE: These args need to stay below the FROM line in order for Docker to recognize them.
ARG BUILD_DATE
ARG VCS_REF
ARG GH_PAGES_VERSION=226
ARG NODE_MAJOR_VERSION=16
ARG GH_PAGES_VERSION=228
ARG NODE_MAJOR_VERSION=18

RUN echo "RUBY_VERSION=${RUBY_VERSION}"
RUN echo "BUILD_DATE=${BUILD_DATE}"
Expand Down Expand Up @@ -60,6 +60,7 @@ RUN curl -sL https://deb.nodesource.com/setup_${NODE_MAJOR_VERSION}.x | bash -\
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g npm\
&& npm install -g yarn@1

RUN node -v
Expand Down