fix: create a new workflow #1324
Workflow file for this run
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: CI | |
on: | |
# Triggers the workflow on push (branch and tag) or pull request events | |
push: | |
branches: | |
- "main" | |
- "release-*" | |
tags: | |
- "*" | |
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/[email protected] | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
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@v1 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
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@v2 | |
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 }} |