From a0ee6115780d0fa6d9420b1dec1796910e907d2a Mon Sep 17 00:00:00 2001 From: naglepuff Date: Thu, 16 May 2024 18:13:37 -0400 Subject: [PATCH 1/3] Add GH action to build berkeley schema images Triggers on pushes to protected branch `berkeley-schema-migration`. Builds images and tags them as related to the migration effort. --- .github/workflows/berkeley-image.yml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/berkeley-image.yml diff --git a/.github/workflows/berkeley-image.yml b/.github/workflows/berkeley-image.yml new file mode 100644 index 00000000..f225b000 --- /dev/null +++ b/.github/workflows/berkeley-image.yml @@ -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 }} From 0f375ce709e691664b40d65d931cebc9f29c2457 Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 17 May 2024 10:28:38 -0400 Subject: [PATCH 2/3] Fix bad configuration --- .github/workflows/berkeley-image.yml | 70 ++++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/berkeley-image.yml b/.github/workflows/berkeley-image.yml index f225b000..bf461742 100644 --- a/.github/workflows/berkeley-image.yml +++ b/.github/workflows/berkeley-image.yml @@ -3,7 +3,7 @@ name: build-berkeley-image on: push: branches: - - main + - berkeley-schema-migration env: IS_ORIGINAL_REPO: ${{ github.repository == 'microbiomedata/nmdc-server' }} @@ -16,37 +16,37 @@ jobs: 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 }} + 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 }} From 10d26e14408882b434efe59eb8637859098d6e5f Mon Sep 17 00:00:00 2001 From: naglepuff Date: Mon, 17 Jun 2024 16:02:51 -0400 Subject: [PATCH 3/3] Remove redundant addition of `berkeley` to tag --- .github/workflows/berkeley-image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/berkeley-image.yml b/.github/workflows/berkeley-image.yml index bf461742..9aa108b0 100644 --- a/.github/workflows/berkeley-image.yml +++ b/.github/workflows/berkeley-image.yml @@ -40,7 +40,6 @@ jobs: prefix=berkeley tags: | type=ref,event=branch - type=raw,value=berkeley - name: Build and push uses: docker/build-push-action@v5