Merge pull request #11 from kotalco/dashboard #14
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: Build-Push dashboard | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
- name: Cypress run | |
uses: cypress-io/github-action@v5 | |
with: | |
install-command: yarn --frozen-lockfile --silent | |
# using the action parameter command causes multiple other parameters to be ignored | |
#command: yarn cypress:open | |
component: true | |
browser: chrome | |
build: yarn build | |
start: yarn start | |
wait-on: "http://localhost:3000" | |
# wait for 2 minutes for the server to respond | |
wait-on-timeout: 120 | |
# Cancel the run after 2 failed tests # run with cloud only | |
# auto-cancel-after-failures: 2 | |
- name: Cypress Artifacts | |
# after the test run completes store videos and any screenshots | |
# store generated videos and screenshots as CI artifacts. | |
uses: actions/upload-artifact@v3 | |
# add the line below to store screenshots only on failures | |
# if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cypress-videos | |
path: cypress/videos | |
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | |
- name: Generate Docker metadata | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
docker.io/kotalco/cloud-dashboard | |
tags: | | |
type=ref,event=tag | |
type=sha,prefix=,suffix=,format=short | |
flavor: | | |
latest=true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: kotalco | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |