Skip to content

Commit

Permalink
Add GH action to build berkeley schema images
Browse files Browse the repository at this point in the history
Triggers on pushes to protected branch `berkeley-schema-migration`.
Builds images and tags them as related to the migration effort.
  • Loading branch information
naglepuff committed May 16, 2024
1 parent 94413ba commit a0ee611
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/berkeley-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build-berkeley-image

on:
push:
branches:
- main

env:
IS_ORIGINAL_REPO: ${{ github.repository == 'microbiomedata/nmdc-server' }}

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
image: [server, client, worker]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/microbiomedata/nmdc-server/${{ matrix.image }}
flavor: |
latest=false
prefix=berkeley
tags: |
type=ref,event=branch
type=raw,value=berkeley
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image == 'client' && 'web' || '.' }}
push: ${{ env.IS_ORIGINAL_REPO }}
file: ${{ matrix.image == 'worker' && 'Dockerfile.worker' || matrix.image == 'client' && 'web/Dockerfile' || 'Dockerfile' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a0ee611

Please sign in to comment.