Skip to content

Update Node.js to v20.18.1 #387

Update Node.js to v20.18.1

Update Node.js to v20.18.1 #387

name: PFI Exemplar Container Image Build
on:
push:
branches:
- main
paths:
- 'javascript/tbdex-pfi-exemplar/*'
- .github/workflows/pfi-exemplar-container-image.yaml
pull_request:
branches:
- main
paths:
- 'javascript/tbdex-pfi-exemplar/*'
- .github/workflows/pfi-exemplar-container-image.yaml
jobs:
build-image:
name: Build Container Image / javascript/tbdex-pfi-exemplar
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ghcr.io/tbd54566975/tbd-examples-tbdex-pfi-exemplar
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
- name: Build and push container image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: javascript/tbdex-pfi-exemplar
push: true
target: ${{ matrix.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy new image
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
run: |
set -ex
mkdir ~/.ssh
echo "${{ secrets.RELEASE_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
git clone [email protected]:tbdeng/tbd-pfi-exemplar-helm
cd tbd-pfi-exemplar-helm
git config user.email [email protected]
git config user.name "tbd deployer"
newtag="$(echo "${{ steps.meta.outputs.tags }}" | tail -n1)"
sed -i "s#image: ghcr.io/tbd54566975/tbd-examples-tbdex-pfi-exemplar:.*#image: ${newtag}#" values.yaml
git commit values.yaml -m "Update image to ${newtag}"
git push