Merge branch 'develop' #1095
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: Docker Image CI | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: install node packages | |
run: npm ci | |
- name: Build Js bundle | |
run: npm run build | |
- name: Build DM Widgets | |
run: cd widgets && npm ci && npm run build && cd .. | |
# - name: Start MongoDB | |
# uses: supercharge/[email protected] | |
# with: | |
# mongodb-version: '6.0' | |
# - name: Run tests | |
# run: npm test | |
- name: Extract version number | |
run: echo VERSION=$( node -e 'console.log(require("./package.json").version)' ) >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: harbor.cs.dm.unipi.it/dm-manager/dm-manager | |
tags: | | |
type=raw,value=latest | |
type=ref,event=tag | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
- name: Login to docker Harbor | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.HARBOR_ROBOT_USERNAME }} | |
password: ${{ secrets.HARBOR_ROBOT }} | |
registry: harbor.cs.dm.unipi.it | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
push: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Trigger update on Watchtower | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
curl -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" https://watchtower.delta.cs.dm.unipi.it/v1/update | |