Commit de22dda0 authored by Wohlgemuth, Jason's avatar Wohlgemuth, Jason
Browse files

ci: Use newly built image, trigger job when content changes

parent b652893b
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
default:
  tags:
    - cpu
  image: ghcr.io/jhwohlgemuth/dev:0.0.13
  image: code.ornl.gov:4567/gshs/common/sites/fact-sheets:latest
  before_script:
    - curl -LOJ https://github.com/errata-ai/vale/releases/download/v3.2.2/vale_3.2.2_Linux_64-bit.tar.gz
    - tar -xvzf vale_3.2.2_Linux_64-bit.tar.gz -C /bin
    - chmod +x ./scripts/*
    - export HOME=/root
    - git config --global user.name "${USER}"
    - git config --global user.email "${EMAIL}"
    - /root/.nix-profile/bin/nix-env -iA nixpkgs.nodejs_20
    - git --version
    - git config --list
    - node --version
    - npm --version
    - vale --version
    - weasyprint --version
    - npm install

variables:
@@ -21,19 +19,24 @@ variables:
  EMAIL: wohlgemuthjh@ornl.gov

stages:
  - lint
  - validate
  - analyze
  - build

lint:
  stage: lint
lint-prose:
  rules:
    - changes:
      - src/content/**/*
  stage: analyze
  inherit:
    default: true
    variables: true
  script: npm run lint

validate:
  stage: validate
  rules:
    - changes:
      - src/content/**/*
  stage: analyze
  inherit:
    default: true
    variables: true
@@ -42,18 +45,17 @@ validate:
    - npm run validate

build-and-publish:
  rules:
    - changes:
      - src/content/**/*
  stage: build
  inherit:
    default: true
    variables: true
  script:
    - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install git-lfs weasyprint zint
    - weasyprint --version
    - git lfs install
    - npm run build
    - git clone https://user:${ACCESS_TOKEN}@code-int.ornl.gov/sites/fact-sheets.git site
    - ls
    - ls site
    - rm -rf ./site/html/_astro
    - cp --force --recursive --update --verbose html site
    - cd site

docker/Brewfile

0 → 100644
+4 −0
Original line number Diff line number Diff line
brew "git-lfs"
brew "node"
brew "weasyprint"
brew "zint"
 No newline at end of file

docker/Dockerfile

0 → 100644
+25 −0
Original line number Diff line number Diff line
FROM ghcr.io/jhwohlgemuth/dev:latest
#
# %labels
#
LABEL author="Jason Wohlgemuth"
LABEL org.opencontainers.image.source=https://code.ornl.gov/GSHS/common/sites/fact-sheets
LABEL org.opencontainers.image.description="Environment for building Fact Sheets"
LABEL org.opencontainers.image.licenses=MIT
#
# %environment
#
ENV HOME=/root
#
# %files
#
COPY ./Brewfile /tmp/
#
# %post
#
RUN eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
    && brew bundle --file /tmp/Brewfile \
    && brew cleanup --prune=all \
    && curl -LOJ https://github.com/errata-ai/vale/releases/download/v3.2.2/vale_3.2.2_Linux_64-bit.tar.gz \
    && tar -xvzf vale_3.2.2_Linux_64-bit.tar.gz -C /bin \
    && cleanup
 No newline at end of file