Skip to content

Commit

Permalink
Updates for Feb 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
trackleft committed Feb 6, 2024
1 parent 4fb48d5 commit 62a58b7
Show file tree
Hide file tree
Showing 6 changed files with 1,606 additions and 552 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cdn-deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
jobs:
deploy:
name: Deploy CDN assets
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ on:
jobs:
release:
name: Create Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.AZ_ICONS_DEPLOY_KEY }}

- name: Set variables for Docker images
run: |
oldhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
registry='docker.pkg.github.com'
registry='ghcr.io'
imageprefix="${registry}/${GITHUB_REPOSITORY}/"
imagename='az-nodejs-ephemeral'
imagestem="${imageprefix}${imagename}:"
Expand All @@ -29,6 +29,9 @@ jobs:
echo "AZ_ICONS_SOURCE_DIR=az-icons-src" >> ${GITHUB_ENV}
echo "AZ_ICONS_FROZEN_DIR=/azbuild/az-icons" >> ${GITHUB_ENV}
- 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 }}
Expand All @@ -38,7 +41,7 @@ jobs:
workingtitle=$(docker build -q . )
tempname="old${AZ_OLD_HASH}"
docker run --name "$tempname" "$workingtitle" true
docker cp "${tempname}:${AZ_ICONS_FROZEN_DIR}/." .
docker cp -a "${tempname}:${AZ_BOOTSTRAP_FROZEN_DIR}/." .
docker rm "$tempname"
lockhash=${{ hashFiles('Dockerfile', 'package.json', 'package-lock.json', 'scripts/*') }}
ephemeral="${AZ_IMAGE_STEM}${lockhash}"
Expand Down Expand Up @@ -74,13 +77,13 @@ jobs:

- name: Save new SHA to file
run: |
echo "{\"sha\": \"$(git rev-parse HEAD)\"}" > variables.json
echo "{\"sha\": \"$(git rev-parse HEAD)\"}" > ${{ runner.temp }}/variables.json
- name: Upload variables
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: artifact
path: variables.json
name: variables-json-artifact
path: ${{ runner.temp }}

dispatch:
needs: release
Expand All @@ -92,18 +95,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download variables
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: artifact
name: variables-json-artifact
path: ${{ runner.temp }}

- name: Update environment variables
run: |
echo "RELEASE_SHA=$(cat artifact/variables.json | jq -r '.sha' )" >> ${GITHUB_ENV}
variablesfile=${{ runner.temp }}/variables.json
echo "RELEASE_SHA=$(cat ${variablesfile} | jq -r '.sha' )" >> ${GITHUB_ENV}
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> ${GITHUB_ENV}
- name: Notify dependencies
uses: peter-evans/repository-dispatch@1708dda5703a768a0fb0ef6a7a03a0c3805ebc59
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
repository: ${{ matrix.repo }}
event-type: az_icons_release
client-payload: '{"version": "${{ github.event.inputs.version }}", "ref": "${{ env.RELEASE_SHA }}", "sha": "${{ env.RELEASE_SHA }}"}'
client-payload: '{"version": "${{ github.event.inputs.version }}", "ref": "${{ env.RELEASE_SHA }}", "sha": "${{ env.RELEASE_SHA }}", "branch": "${{env.BRANCH_NAME}}"}'
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:18.18.0-bookworm-slim
FROM --platform=linux/amd64 node:20.11.0-bookworm-slim

ENV LANG C.UTF-8

Expand Down Expand Up @@ -32,6 +32,6 @@ RUN apt-get update \
&& npm config set cache='/tmp/.npm' \
&& chmod 755 /root \
&& chmod 644 /root/.npmrc \
&& npm install -g npm-check-updates@12.0.0 \
&& npm install --location=global npm-check-updates@16.14.12 \
&& npm install \
&& find node_modules -name '.DS_Store' -exec rm {} \;
Loading

0 comments on commit 62a58b7

Please sign in to comment.