Skip to content

Release Project

Release Project #69

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0
name: Release Project
on:
release:
types: [released]
jobs:
push_to_registry:
name: Build and publish
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/[email protected]
- name: Cache Docker Register
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Extract tag name
id: extract_tagname
shell: bash
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Use Node.js 14.x
uses: actions/setup-node@v4
with:
node-version: '14.x'
- name: Build application with npm
run: |
cd packages/compas-open-scd
npm ci
npm run-script build
- name: Build and push docker image to Docker Hub
uses: docker/build-push-action@v5
with:
# Set the context to use the packages/compas-open-scd directory and not execute it's own git checkout.
context: packages/compas-open-scd
push: true
# Tag the images using the tagname and also latest.
tags: |
lfenergy/compas-open-scd:${{ steps.extract_tagname.outputs.tagname }}
lfenergy/compas-open-scd:latest