Merge pull request #2087 from dictyBase/dependabot/github_actions/dev… #919
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: Node CI Develop | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: set up node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: check out code | |
uses: actions/checkout@v4 | |
- name: rename config file | |
run: mv src/common/utils/clientConfig.sample.ts src/common/utils/clientConfig.ts | |
- name: install | |
run: yarn install | |
- name: unit tests | |
run: yarn test-coverage | |
env: | |
CI: true | |
- name: upload test coverage to codecov | |
uses: codecov/codecov-action@v3.1.4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
needs: test | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: check out code | |
uses: actions/checkout@v4 | |
- name: set up docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: cache docker layers | |
uses: actions/cache@v3.3.2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: log into dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: get short sha | |
id: type | |
run: | | |
sha=$(git rev-parse --short HEAD) | |
echo ::set-output name=id::${sha} | |
- name: docker build and push (ericdev) | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: dictybase/dicty-frontpage:ericdev-develop-${{ steps.type.outputs.id }} | |
build-args: | | |
graphql_server=https://ericgraphql.dictybase.dev | |
client_keys=https://raw.githubusercontent.com/dictybase-playground/client-keys/2.0.1/clientConfig.eric.js | |
ga_tracking_id=-UA-146763741-1 | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: docker build and push (devsidd) | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: dictybase/dicty-frontpage:devsidd-develop-${{ steps.type.outputs.id }} | |
build-args: | | |
graphql_server=https://siddgraphql.dictybase.dev | |
client_keys=https://raw.githubusercontent.com/dictybase-playground/client-keys/2.0.1/clientConfig.sidd.js | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache |