feat: initial refactor for v4 #305
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: | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: "pnpm" | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm run build --if-present | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get the version | |
id: get_version | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/*\//} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}} | |
with: | |
context: . | |
push: true | |
tags: boomerangio/task-flow:latest,boomerangio/task-flow:${{ steps.get_version.outputs.VERSION }} | |
- 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 }} |