Updates for GitHub pages v232 #42
Workflow file for this run
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
name: Build & Release | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build_release: | |
permissions: write-all | |
name: "Build and Release" | |
strategy: | |
matrix: | |
VERSIONS: [ {ruby: 2.7.3, bundler: 2.4.22, ghpages: 226}, {ruby: 2.7.4, bundler: 2.4.22, ghpages: 231}, {ruby: 3.3.4, bundler: 2.5.23, ghpages: 232}] | |
NODE_MAJOR_VERSION: [20,21,22] | |
runs-on: ubuntu-latest | |
env: | |
RUBY_VERSION: ${{ matrix.VERSIONS.ruby }} | |
BUNDLER_VERSION: ${{ matrix.VERSIONS.bundler }} | |
NODE_MAJOR_VERSION: ${{ matrix.NODE_MAJOR_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 BUNDLER_VERSION=${BUNDLER_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 | |
- name: Inspect the built image | |
run: docker inspect ${REGISTRY}/${IMAGE_NAME}:ruby${RUBY_VERSION}-node${NODE_MAJOR_VERSION} | |
- name: Login to registry (non-PR only) | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Container to registry (non-PR only) | |
if: github.event_name != 'pull_request' | |
run: docker push --all-tags ${REGISTRY}/${IMAGE_NAME} |