Merge pull request #71 from IUBLibTech/fix-build-issues #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Builds image and stores in ghcr.io then sends webhook to deploy new image to timeliner.dlib.indiana.edu | |
name: Podman Image CI | |
on: | |
push: | |
branches: ['main', 'demo'] | |
env: | |
REGISTRY_USER: ${{ github.actor }} | |
REGISTRY_PASSWORD: ${{ github.token }} | |
IMAGE_REGISTRY: ghcr.io/iublibtech | |
IMAGE_TAG: ${{ fromJSON('{"refs/heads/main":"develop","refs/heads/demo":"production"}')[github.ref] }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Node 18 build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-18-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-18-pnpm-store- | |
- run: pnpm i --frozen-lockfile | |
- run: pnpm run build | |
- run: pnpm run test | |
# Unchanged from the original. | |
- name: Build Image | |
id: build_image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: timeliner | |
tags: ${{ env.IMAGE_TAG }} ${{ github.sha }} | |
containerfiles: ./Dockerfile | |
oci: true | |
- name: Push To GHCR | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
tags: ${{ steps.build_image.outputs.tags }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |
username: ${{ env.REGISTRY_USER }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |
extra-args: | | |
--disable-content-trust |