Merge pull request #1062 from microbiomedata/submission-schema-8.1.1 #497
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
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/[email protected] | |
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/[email protected] | |
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/[email protected] | |
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 }} |