Skip to content

Merge pull request #53 from Enraged-Dun-Cookie-Development-Team/feat-… #61

Merge pull request #53 from Enraged-Dun-Cookie-Development-Team/feat-…

Merge pull request #53 from Enraged-Dun-Cookie-Development-Team/feat-… #61

name: Node.js CI
on:
# for debug
# pull_request:
push:
branches: [ master ]
tags:
- v*
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
-
name: Login npm registry
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGE_TOKEN }}" > ~/.npmrc
-
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
-
name: build frontend
run: npm install && npm run build:prod
-
name: Build and push release
uses: docker/build-push-action@v4
if: "startsWith(github.ref, 'refs/tags/v')"
with:
context: .
push: true
tags: ceobecanteen/ceobe-canteen-admin:${{ env.TAG_NAME }}
provenance: false
sbom: false
-
name: Build and push to admin
uses: docker/build-push-action@v4
if: "!startsWith(github.ref, 'refs/tags/v')"
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: ceobecanteen/ceobe-canteen-admin
provenance: false
sbom: false