Merge pull request #55 from Enraged-Dun-Cookie-Development-Team/feat-… #65
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: 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 | |