Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

automatically deploy new versions of the pfi exemplar #21

automatically deploy new versions of the pfi exemplar

automatically deploy new versions of the pfi exemplar #21

name: PFI Exemplar Container Image Build
on:
push:
branches:
- main
- pfi-exemplar-autodeploy
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: javascript/tbdex-pfi-exemplar
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the container registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.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@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1
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/pfi-exemplar-autodeploy" }}

Check failure on line 59 in .github/workflows/pfi-exemplar-container-image.yaml

View workflow run for this annotation

GitHub Actions / PFI Exemplar Container Image Build

Invalid workflow file

The workflow is not valid. .github/workflows/pfi-exemplar-container-image.yaml (Line: 59, Col: 13): Unexpected symbol: '"refs/heads/pfi-exemplar-autodeploy"'. Located at position 52 within expression: github.event_name == 'push' && github.event.ref == "refs/heads/pfi-exemplar-autodeploy"
run: |
set -ex
mkdir ~/.ssh
echo "${RELEASE_SSH_KEY}" > ~/.ssh/id_ed25519
git clone [email protected]:tbdeng/tbd-pfi-exemplar-helm
cd tbd-pfi-exemplar-helm
newtag="$(echo "${{ steps.meta.outputs.tags }}" | tail -n1)"
sed -i "s#image: ghcr.io/tbd54566975/tbd-examples-tbdex-pfi-exemplar:.*#image: ghcr.io/tbd54566975/tbd-examples-tbdex-pfi-exemplar:test#" values.yaml