Skip to content

CI

CI #1

Workflow file for this run

name: build
on:
push:
branches: [ "master", "main"]
env:
DOCKER_IMAGE: morya/meedu-backend-v2
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{env.DOCKER_IMAGE}}:${{github.REF_NAME}}-${{github.run_id}}