Skip to content

Commit

Permalink
setup gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleshike committed Apr 19, 2024
1 parent a4ec5c7 commit 1a4e754
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 65 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn install
node-version-file: ".node-version"

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Initialize mandatory git config
uses: fregante/setup-git-user@v1

# Build assets
- run: yarn install
- run: yarn build
- run: npm pack
- name: Extract Package Version
Expand Down
92 changes: 46 additions & 46 deletions .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: Deploy to github pages
on:
workflow_dispatch:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
gh-pages-deploy:
name: Deploying to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'

- name: Configure npm
run: npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build-storybook

- name: Upload
uses: actions/upload-pages-artifact@v3
with:
path: 'storybook-static'

- name: Deploy
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
name: Deploy to github pages
on:
workflow_dispatch:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
gh-pages-deploy:
name: Deploying to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".node-version"
cache: "yarn"

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Install dependencies
run: yarn install

- name: Build
run: yarn build-storybook

- name: Upload
uses: actions/upload-pages-artifact@v3
with:
path: "storybook-static"

- name: Deploy
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
9 changes: 7 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: ".node-version"

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
yarn
- run: yarn lint
- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint
10 changes: 7 additions & 3 deletions .github/workflows/prepare-hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
description: "The version you want to release."
required: true

jobs:
Expand All @@ -15,9 +15,14 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version-file: ".node-version"

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Create hotfix branch
run: git checkout -b hotfix/${{ github.event.inputs.version }}
Expand Down Expand Up @@ -56,4 +61,3 @@ jobs:
head: hotfix/${{ github.event.inputs.version }}
base: develop
title: Merge hotfix/${{ github.event.inputs.version }} into develop branch

10 changes: 7 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
description: "The version you want to release."
required: true

jobs:
Expand All @@ -15,16 +15,21 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version-file: ".node-version"

- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}

- name: Initialize mandatory git config
uses: fregante/setup-git-user@v1

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Bump version in package.json
run: yarn version --new-version ${{ github.event.inputs.version }} --no-git-tag-version

Expand Down Expand Up @@ -56,4 +61,3 @@ jobs:
head: release/${{ github.event.inputs.version }}
base: develop
title: Merge release/${{ github.event.inputs.version }} into develop branch

18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn
- run: yarn test
node-version-file: ".node-version"

- name: Setup yarn
run: |
echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Install dependencies
run: yarn install

- name: Test
run: yarn test

0 comments on commit 1a4e754

Please sign in to comment.