Skip to content

build

build #1

Workflow file for this run

name: build
on:
push:
branches: [ "master", "main"]
# pull_request:
# branches: [ "master" ]
env:
DOCKER_IMAGE: morya/meedu-pc-v1
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 }}
- run: |
echo ${{ github.repository }}:${{github.REF_NAME}}-${{github.run_id}}
echo ${{ github.ACTOR }}
- name: build and push docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: $DOCKER_IMAGE:${{github.REF_NAME}}-${{github.run_id}}