Skip to content

CI

CI #725

Workflow file for this run

name: CI
on:
# Triggers the workflow on push (branch and tag) or pull request events
push:
branches:
- "main"
- "release-*"
tags:
- "[0-9].[0-9]+.[0-9]+"
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
node-version: 16
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
# - run: pnpm run test
- run: pnpm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/*\//}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: boomerangio/flow-client-web:latest,boomerangio/flow-client-web:${{ steps.get_version.outputs.VERSION }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Slack
uses: 8398a7/action-slack@v3
if: ${{ always() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,ref,workflow,took,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}