chore(release): 2.3.0 #20
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
# SPDX-FileCopyrightText: 2022 Johannes Loher | |
# | |
# SPDX-License-Identifier: MIT | |
name: Publish | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
env: | |
node_version: 18 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ env.node_version }} | |
- name: Cache Node.js modules | |
uses: actions/cache@v3 | |
with: | |
path: .npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.OS }}-node- | |
${{ runner.OS }}- | |
- name: Install dependencies | |
run: npm ci --cache .npm --prefer-offline | |
- name: Lint | |
run: npm run lint | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v2 | |
- name: Build | |
run: npm run build | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
publish-to-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ env.node_version }} | |
- name: Cache Node.js modules | |
uses: actions/cache@v3 | |
with: | |
path: .npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.OS }}-node- | |
${{ runner.OS }}- | |
- name: Install dependencies | |
run: npm ci --cache .npm --prefer-offline | |
- name: Download production artifacts for publication | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Publish to npm | |
run: | | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
npm publish --ignore-scripts | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-to-dockerhub: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: johannesloher/foundry-publish | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |