-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# | ||
# GitHub Actions workflow. | ||
# | ||
# Releases the package to npm when a push into main is detected. | ||
# * Checkout the code | ||
# * Install Node.js | ||
# * Install dependencies | ||
# * Pull the latest changes | ||
# * Bump version number | ||
# * Pull the latest changes | ||
# * Generate Docker meta | ||
# * Build and push image | ||
# | ||
|
||
name: 'Release Package: Llana Portal' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
release: | ||
name: 'Release Package: CLI' | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.head_commit.message, '#skip-release') }} | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_CI_CD_RELEASE }} | ||
|
||
- name: 'Install Node.js' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.18.2 | ||
|
||
- name: 'Install dependencies' | ||
run: npm install | ||
|
||
- run: git pull --force | ||
|
||
- name: 'Version Bump' | ||
id: version | ||
if: ${{ !contains(github.event.head_commit.message, '#skip-version-bump') }} | ||
uses: phips28/gh-action-bump-version@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_CI_CD_RELEASE }} | ||
with: | ||
major-wording: 'MAJOR' | ||
minor-wording: 'feature,feat' | ||
patch-wording: 'patch,fixes,fix,misc,docs,refactor' # Providing patch-wording will override commits | ||
commit-message: 'CI: Bump Version to {{version}} [skip ci]' | ||
tag-prefix: 'v' | ||
|
||
- run: git pull --force #Ensure we have the latest package version before pushing to NPM / Docker | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
juicyllama/llana-portal | ||
# ghcr.io/username/app | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=semver,pattern=v{{version}},value=${{ steps.version.outputs.newTag }} | ||
type=semver,pattern=v{{major}}.{{minor}},value=${{ steps.version.outputs.newTag }} | ||
type=semver,pattern=v{{major}},value=${{ steps.version.outputs.newTag }} | ||
type=sha | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: juicyllama | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
#Checkout again to get latest package.json after bump and before we deploy | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_CI_CD_RELEASE }} | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v6 | ||
if: ${{ !contains(github.event.head_commit.message, '#skip-docker-publish') }} | ||
with: | ||
file: ./docker/images/base/Dockerfile | ||
sbom: true | ||
provenance: mode=max | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |