feat(): add widget action (#41) #133
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: Server CI | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'packages/server/**' | |
- 'packages/common-*/**' | |
- 'packages/tests/**' | |
env: | |
IMAGE_TAG: latest | |
IMAGE_REPO: ${{ secrets.DOCKER_USERNAME }} | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
env: | |
APPS: server,stubs,tests | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: yarn install | |
- name: Build the stack | |
run: yarn script build | |
- name: Start containers | |
run: yarn script start | |
- name: Run tests | |
run: yarn script test | |
- name: Collect Docker Logs | |
uses: jwalton/gh-docker-logs@v2.2.0 | |
if: failure() | |
with: | |
images: '${{ secrets.DOCKER_USERNAME }}/iot-server' | |
publish: | |
name: Publish Docker image | |
runs-on: ubuntu-latest | |
needs: tests | |
if: github.ref == 'refs/heads/main' | |
env: | |
APPS: server | |
PLATFORMS: linux/amd64,linux/arm64 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Install dependencies | |
run: yarn install | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build the image | |
run: yarn script build --push |