Skip to content

Commit

Permalink
Closes #1266: Replicate changes needed for Dependabot to work (copyin…
Browse files Browse the repository at this point in the history
…g a fork). (#1304)
  • Loading branch information
mmunro-ltrr authored Oct 18, 2024
1 parent 9b0deb6 commit 2eda397
Show file tree
Hide file tree
Showing 13 changed files with 1,931 additions and 1,579 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cdn-deploy-head.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy 2.x CDN assets to S3 + CloudFront
if: ${{ github.ref_name == '2.x' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cdn-deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy CDN assets to S3 + CloudFront
run: |
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@ on:
version:
description: The version to tag and release
required: true
env:
AZ_EPHEMERALIMAGENAME: ${{ vars.AZ_EPHEMERALIMAGENAME }}

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
ref: 2.x

- name: Set variables for Docker images
run: |
oldhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
registry='ghcr.io'
imageprefix="${registry}/${GITHUB_REPOSITORY}/"
imagename='az-nodejs-ephemeral'
imagestem="${imageprefix}${imagename}:"
echo "AZ_DOCKER_REGISTRY=${registry}" >> ${GITHUB_ENV}
imageprefix=${{ vars.AZ_DOCKER_REGISTRY }}"/${GITHUB_REPOSITORY}/"
imagestem="${imageprefix}${AZ_EPHEMERALIMAGENAME}:"
echo "AZ_OLD_HASH=${oldhash}" >> ${GITHUB_ENV}
echo "AZ_IMAGE_STEM=${imagestem}" >> ${GITHUB_ENV}
echo "AZ_BOOTSTRAP_SOURCE_DIR=/arizona-bootstrap-source" >> ${GITHUB_ENV}
Expand All @@ -34,12 +35,16 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Docker authentication
run: |
docker login "$AZ_DOCKER_REGISTRY" -u "$GITHUB_ACTOR" -p ${{ secrets.GITHUB_TOKEN }}
uses: docker/login-action@v3
with:
registry: ${{ vars.AZ_DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Unconditionally rebuild and save the Docker image
run: |
workingtitle=$(docker build -q . )
workingtitle="${AZ_EPHEMERALIMAGENAME}:working"
docker buildx build --load --platform=linux/amd64 --no-cache -t "$workingtitle" --build-arg AZ_BOOTSTRAP_FROZEN_DIR . \
tempname="old${AZ_OLD_HASH}"
docker run --name "$tempname" "$workingtitle" true
docker cp -a "${tempname}:${AZ_BOOTSTRAP_FROZEN_DIR}/." .
Expand All @@ -66,6 +71,7 @@ jobs:
git commit -m '${{ github.event.inputs.version }}'
git push
echo "RELEASE_SHA=$(git rev-parse HEAD)" >> ${GITHUB_ENV}
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> ${GITHUB_ENV}
- name: Create Release
id: create_release
Expand Down
55 changes: 31 additions & 24 deletions .github/workflows/review-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,37 @@ on:
branches:
- main
- 2.x

env:
AZ_SITE_HOST: ${{ vars.AZ_SITE_HOST }}
AZ_EPHEMERALIMAGENAME: ${{ vars.AZ_EPHEMERALIMAGENAME }}
jobs:
lint-code:
name: Check code for linting errors
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository to workspace
uses: actions/checkout@v4
- name: Set variables for Docker images
run: |
oldhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
registry='ghcr.io'
imageprefix="${registry}/${GITHUB_REPOSITORY}/"
imagename='az-nodejs-ephemeral'
imagestem="${imageprefix}${imagename}:"
echo "AZ_DOCKER_REGISTRY=${registry}" >> ${GITHUB_ENV}
imageprefix=${{ vars.AZ_DOCKER_REGISTRY }}"/${GITHUB_REPOSITORY}/"
imagestem="${imageprefix}${AZ_EPHEMERALIMAGENAME}:"
echo "AZ_OLD_HASH=${oldhash}" >> ${GITHUB_ENV}
echo "AZ_IMAGE_STEM=${imagestem}" >> ${GITHUB_ENV}
echo "AZ_EPHEMERAL_IMAGE=${imagestem}${oldhash}" >> ${GITHUB_ENV}
echo "AZ_BOOTSTRAP_SOURCE_DIR=/arizona-bootstrap-source" >> ${GITHUB_ENV}
echo "AZ_BOOTSTRAP_FROZEN_DIR=/azbuild/arizona-bootstrap" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
- name: Docker authentication
uses: docker/login-action@v3
with:
registry: ghcr.io
registry: ${{ vars.AZ_DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.AZ_DOCKER_REGISTRY_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Search for Docker image
id: dockerpull
continue-on-error: true
Expand All @@ -46,13 +48,14 @@ jobs:
- name: Conditionally rebuild and save the Docker image
if: ${{ steps.dockerpull.outcome == 'failure' }}
run: |
workingtitle=$(docker build -q . )
workingtitle="${AZ_EPHEMERALIMAGENAME}:working"
docker buildx build --load --platform=linux/amd64 --no-cache -t "$workingtitle" --build-arg AZ_BOOTSTRAP_FROZEN_DIR .
tempname="old${AZ_OLD_HASH}"
docker run --name "$tempname" "$workingtitle" true
docker cp -a "${tempname}:${{ env.AZ_BOOTSTRAP_FROZEN_DIR }}/." .
docker cp -a "${tempname}:${AZ_BOOTSTRAP_FROZEN_DIR}/." .
docker rm "$tempname"
lockhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
ephemeral="${{ env.AZ_IMAGE_STEM }}${lockhash}"
ephemeral="${AZ_IMAGE_STEM}${lockhash}"
docker tag "$workingtitle" "$ephemeral"
docker push "$ephemeral"
echo "AZ_EPHEMERAL_IMAGE=${ephemeral}" >> ${GITHUB_ENV}
Expand All @@ -61,16 +64,20 @@ jobs:
sudo touch config.yml
sudo find . -path "./.git" -prune -o -exec chown 1000:1000 {} \;
sudo chown 1000:1000 .
docker run --rm -v $(pwd):"${{ env.AZ_BOOTSTRAP_SOURCE_DIR }}" "${{ env.AZ_EPHEMERAL_IMAGE }}" lint
docker run --rm -v $(pwd):"${AZ_BOOTSTRAP_SOURCE_DIR}" "$AZ_EPHEMERAL_IMAGE" lint
review-site:
name: Build & deploy review site
needs: lint-code
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- name: Checkout repository to workspace
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 20
- name: Find the push source branch name
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -81,11 +88,8 @@ jobs:
- name: Set variables for Docker images
run: |
oldhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
registry='ghcr.io'
imageprefix="${registry}/${GITHUB_REPOSITORY}/"
imagename='az-nodejs-ephemeral'
imagestem="${imageprefix}${imagename}:"
echo "AZ_DOCKER_REGISTRY=${registry}" >> ${GITHUB_ENV}
imageprefix=${{ vars.AZ_DOCKER_REGISTRY }}"/${GITHUB_REPOSITORY}/"
imagestem="${imageprefix}${AZ_EPHEMERALIMAGENAME}:"
echo "AZ_OLD_HASH=${oldhash}" >> ${GITHUB_ENV}
echo "AZ_IMAGE_STEM=${imagestem}" >> ${GITHUB_ENV}
echo "AZ_EPHEMERAL_IMAGE=${imagestem}${oldhash}" >> ${GITHUB_ENV}
Expand All @@ -94,8 +98,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker authentication
run: |
docker login "$AZ_DOCKER_REGISTRY" -u "$GITHUB_ACTOR" -p ${{ secrets.GITHUB_TOKEN }}
uses: docker/login-action@v3
with:
registry: ${{ vars.AZ_DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Search for Docker image
id: dockerpull
continue-on-error: true
Expand All @@ -104,7 +111,8 @@ jobs:
- name: Conditionally rebuild and save the Docker image
if: ${{ steps.dockerpull.outcome == 'failure' }}
run: |
workingtitle=$(docker build -q . )
workingtitle="${AZ_EPHEMERALIMAGENAME}:working"
docker buildx build --load --platform=linux/amd64 --no-cache -t "$workingtitle" --build-arg AZ_BOOTSTRAP_FROZEN_DIR .
tempname="old${AZ_OLD_HASH}"
docker run --name "$tempname" "$workingtitle" true
docker cp -a "${tempname}:${AZ_BOOTSTRAP_FROZEN_DIR}/." .
Expand All @@ -117,7 +125,6 @@ jobs:
- name: Build variables
run: |
echo "AZ_REVIEW_BASEURL=/arizona-bootstrap/${AZ_TRIMMED_REF}" >> ${GITHUB_ENV}
echo "AZ_SITE_HOST=https://review.digital.arizona.edu" >> ${GITHUB_ENV}
- name: Build review site artifact
run: |
sudo touch config.yml
Expand All @@ -139,7 +146,7 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
aws-region: ${{ secrets.AWS_REGION }}
- name: Deploy review site artifact to S3 + CloudFront
run: |
aws s3 sync --delete _site/ s3://${{ secrets.REVIEW_BUCKET }}${AZ_REVIEW_BASEURL}/
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:20.17.0-bookworm-slim
FROM node:20.18.0-bookworm-slim

ENV LANG C.UTF-8

Expand Down Expand Up @@ -37,7 +37,7 @@ RUN apt-get update \
&& chmod 755 /root \
&& touch /root/.npmrc \
&& chmod 644 /root/.npmrc \
&& npm install --location=global npm-check-updates@16.14.20 \
&& npm install --location=global npm-check-updates@17.1.3 \
&& curl 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' -o /tmp/awscliv2.zip \
&& unzip -d /tmp /tmp/awscliv2.zip \
&& /tmp/aws/install \
Expand All @@ -49,8 +49,8 @@ WORKDIR $AZ_BOOTSTRAP_FROZEN_DIR
RUN mkdir /home/node/.npm \
&& chown node:node /home/node/.npm \
&& npm config set cache='/home/node/.npm' \
&& npm install \
&& find node_modules -name '.DS_Store' -exec rm {} \; \
&& npm install --foreground-scripts=true --loglevel=verbose \
&& find node_modules -name '.DS_Store' -exec rm {} \; \
&& chown -R node:node "$AZ_BOOTSTRAP_FROZEN_DIR"

USER node:node
Expand Down
4 changes: 2 additions & 2 deletions dist/css/arizona-bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -18868,10 +18868,10 @@ a {
display: flex;
}
.btn-group-justified .btn {
-ms-flex-preferred-size: 0;
flex-basis: 0;
-ms-flex-positive: 1;
flex-grow: 1;
-ms-flex-preferred-size: 0;
flex-basis: 0;
}

.card .card-header, .well .card-header,
Expand Down
2 changes: 1 addition & 1 deletion dist/css/arizona-bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/arizona-bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/arizona-bootstrap.min.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 2eda397

Please sign in to comment.