Skip to content

Commit 4f96ce1

Browse files
authored
15 subsequent fixes for cicd (#16)
- combined deployment pipeline - better naming - cleaned up env
1 parent 46d03a8 commit 4f96ce1

File tree

5 files changed

+41
-54
lines changed

5 files changed

+41
-54
lines changed

.devcontainer/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ FROM mcr.microsoft.com/devcontainers/base:alpine-${ALPINE_VERSION}
55

66
ARG NODE_VERSION
77
RUN apk update && apk add --no-cache nodejs=${NODE_VERSION} npm
8-
9-
WORKDIR /workspaces/datc

.env

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
NODE_VERSION=20.15
2-
UBUNTU_VERSION=20.04
1+
NODE_VERSION=20.15

.github/workflows/deploy-storybook.yml .github/workflows/cd-pipeline.yml

+38-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Storybook to GitHub Pages Pipeline
1+
name: Continuous Deployment Pipeline
2+
3+
permissions:
4+
contents: write
5+
pages: write
6+
id-token: write
27

38
on:
49
push:
510
branches:
611
- production
712

8-
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
12-
1313
concurrency:
1414
group: "pages"
1515
cancel-in-progress: true
1616

1717
jobs:
18-
deploy:
18+
deploy-storybook-to-github-pages:
1919
environment:
2020
name: github-pages
2121
url: ${{ steps.deployment.outputs.page_url }}
@@ -50,3 +50,34 @@ jobs:
5050
- name: Deploy to GitHub Pages
5151
id: deployment
5252
uses: actions/deploy-pages@v4
53+
54+
publish-package-to-npm:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: ${{ env.NODE_VERSION }}
66+
registry-url: "https://registry.npmjs.org"
67+
68+
- name: Install dependencies
69+
run: npm ci
70+
71+
- name: Get version
72+
id: package-version
73+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
74+
75+
- name: Create and push tag
76+
run: |
77+
git tag v${{ steps.package-version.outputs.version }}
78+
git push origin v${{ steps.package-version.outputs.version }}
79+
80+
- name: Publish to NPM
81+
run: npm publish
82+
env:
83+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-package.yml

-41
This file was deleted.

.github/workflows/check-version.yml .github/workflows/version-pipeline.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Version Check
1+
name: Versioning Pipeline
22

33
on:
44
pull_request:
55
branches:
66
- production
77

88
jobs:
9-
version-check:
9+
check:
1010
runs-on: ubuntu-latest
1111

1212
steps:

0 commit comments

Comments
 (0)