Bump jsonpath-plus and serverless-offline in /node #974
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: test + publish | |
on: push | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "18.13" | |
- name: install | |
run: cd node && npm ci | |
- name: test audit | |
run: cd node && npm run test:audit | |
- name: test format | |
run: cd node && npm run test:format | |
- name: test lint | |
run: cd node && npm run test:lint | |
- name: test types | |
run: cd node && npm run test:types | |
- name: test license | |
run: cd node && npm run test:license | |
- name: test behaviors | |
run: cd node && npm run test | |
publish-check: | |
name: publish check | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
outputs: | |
is_release: ${{ steps.is_release.outputs.is_release }} | |
steps: | |
- id: is_release | |
run: | | |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9.]*)?$ ]]; then | |
echo ::set-output name=is_release::true | |
fi | |
build-and-publish: | |
name: build + push docker image | |
runs-on: ubuntu-latest | |
needs: | |
- publish-check | |
- test | |
if: needs.publish-check.outputs.is_release || github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: docker tag | |
id: tag | |
run: | | |
IMAGE_TAG=${GITHUB_SHA} | |
echo ::set-output name=image_tag::${IMAGE_TAG} | |
- name: docker login | |
run: docker login -u ${{ secrets.DOCKER_LOGIN }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- name: docker build | |
run: export DOCKER_IMAGE=mentorpal/mentor-graphql:${{ steps.tag.outputs.image_tag }} && make docker-build | |
- name: docker tag release as version | |
if: needs.publish-check.outputs.is_release == 'true' | |
run: docker tag "mentorpal/mentor-graphql:${{ steps.tag.outputs.image_tag }}" "mentorpal/mentor-graphql:${GITHUB_REF#refs/tags/}" | |
- name: docker tag main as latest | |
if: github.ref == 'refs/heads/main' | |
run: docker tag "mentorpal/mentor-graphql:${{ steps.tag.outputs.image_tag }}" "mentorpal/mentor-graphql:latest" | |
- name: docker push | |
run: docker push --all-tags mentorpal/mentor-graphql |