Skip to content

July 2023 v1

July 2023 v1 #484

Workflow file for this run

name: deploy
on:
push:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: [server, client, worker]
steps:
-
name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#
# SERVER
#
-
name: Build and push server
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'server' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/server:{0}', github.event.release.tag_name || 'latest') }}
push: true
-
name: Deploy server
uses: fjogeleit/http-request-action@v1.3.3
if: ${{ matrix.image == 'server' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-backend?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}
#
# CLIENT
#
-
name: Build and push client
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'client' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/client:{0}', github.event.release.tag_name || 'latest') }}
context: web
push: true
-
name: Deploy client
uses: fjogeleit/http-request-action@v1.3.3
if: ${{ matrix.image == 'client' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-frontend?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}
#
# WORKER
#
-
name: Build and push worker
uses: docker/build-push-action@v2
if: ${{ matrix.image == 'worker' }}
with:
tags: ${{ format('ghcr.io/microbiomedata/nmdc-server/worker:{0}', github.event.release.tag_name || 'latest') }}
file: ./Dockerfile.worker
push: true
-
name: Deploy worker
uses: fjogeleit/http-request-action@v1.3.3
if: ${{ matrix.image == 'worker' && github.event_name == 'push' }}
with:
url: 'https://rancher2.spin.nersc.gov/v3/project/c-tmq7p:p-bkv45/workloads/deployment:nmdc-dev:portal-worker?action=redeploy'
method: 'POST'
username: ${{ secrets.SPIN_USER }}
password: ${{ secrets.SPIN_PASSWORD }}