Skip to content

Commit

Permalink
ci: setup release and build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Trugamr committed Jan 19, 2024
1 parent 55e56e4 commit 99a1066
Show file tree
Hide file tree
Showing 8 changed files with 1,057 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "trugamr/dabba" }],
"commit": false,
"fixed": [],
"linked": [],
"privatePackages": { "version": true, "tag": true },
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/poor-geese-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dabba": minor
---

Initial release
43 changes: 43 additions & 0 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Publish Image

on:
release:
types:
- published

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
51 changes: 51 additions & 0 deletions .github/workflows/create-release-pull-request-or-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Release Pull Request or Publish

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

# Reset permissions for the workflow
permissions: {}

jobs:
create-release-pull-request-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
contents: write # Create release (changesets/action)
issues: write # Post issue comments (changesets/action)
pull-requests: write # Create pull requests (changesets/action)

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.11.0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install changesets CLI
run: pnpm install -D @changesets/cli

- name: Create Release Pull Request or Publish
uses: changesets/action@v1
id: changesets
# GITHUB_TOKEN doesn't trigger workflow on automated release
# https://github.com/orgs/community/discussions/26875
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
publish: pnpm changeset publish
title: Create new release
commit: 'chore: version release'
setupGitUser: false
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Self-hosted dashboard to manage docker compose stacks.

[![Docker Image Version](https://ghcr-badge.egpl.dev/trugamr/dabba/latest_tag?trim=major&label=latest)](https://github.com/trugamr/dabba/pkgs/container/dabba)
[![Docker Image](https://ghcr-badge.egpl.dev/trugamr/dabba/size)](https://github.com/trugamr/dabba/pkgs/container/dabba)
[![GitHub issues](https://img.shields.io/github/issues/trugamr/dabba)](https://github.com/trugamr/dabba/issues)

<img src="assets/preview.png" />
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "dabba",
"version": "0.0.0",
"private": true,
"sideEffects": false,
"type": "module",
Expand Down Expand Up @@ -38,6 +39,8 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@remix-run/dev": "^2.4.1",
"@types/nprogress": "^0.2.3",
"@types/react": "^18.2.20",
Expand Down
Loading

0 comments on commit 99a1066

Please sign in to comment.