generated from trueberryless-org/template-blazor-mysql
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from trueberryless-org/update-template-files
[ci] sync template files
- Loading branch information
Showing
17 changed files
with
561 additions
and
237 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 @@ | ||
# 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) |
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,14 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ "repo": "trueberryless-org/mutanuq" } | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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 |
---|---|---|
@@ -1,25 +1,8 @@ | ||
**/.dockerignore | ||
**/.env | ||
**/node_modules/ | ||
**/dist | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.idea | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md | ||
npm-debug.log | ||
.coverage | ||
.coverage.* | ||
.env | ||
.aws |
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,202 @@ | ||
name: Deployment | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
# Automatically cancel in-progress actions on the same branch | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
REGISTRY: docker.io | ||
IMAGE_OWNER: trueberryless | ||
IMAGE_NAME: mutanuq | ||
NODE_VERSION: 20 | ||
|
||
jobs: | ||
changes: | ||
name: Filter | ||
runs-on: ubuntu-latest | ||
outputs: | ||
starlight: ${{ steps.filter.outputs.starlight }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
starlight: | ||
- 'starlight/**' | ||
changesets: | ||
name: Changesets | ||
runs-on: ubuntu-latest | ||
outputs: | ||
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PNPM | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
|
||
- name: Install Dependencies | ||
run: pnpm i | ||
|
||
- name: Create Release Pull Request | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
commit: "[ci] release" | ||
title: "[ci] release" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
image-tag: | ||
name: Image Tag | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IMAGE_TAG: ${{ env.IMAGE_TAG }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Read version from package.json | ||
id: get_version | ||
run: | | ||
VERSION=$(jq -r '.version' starlight/package.json) | ||
echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV | ||
deployment: | ||
needs: [changes, changesets, image-tag] | ||
if: > | ||
( | ||
needs.changesets.outputs.hasChangesets == 'false' && | ||
( | ||
contains(github.event.head_commit.message, 'deploy') || | ||
contains(github.event.head_commit.message, '[ci] release') | ||
) | ||
) || | ||
github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PNPM | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
package_json_file: ./starlight/package.json | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: pnpm | ||
cache-dependency-path: ./pnpm-lock.yaml | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
shell: bash | ||
working-directory: ./starlight | ||
|
||
- name: Build Website | ||
run: pnpm run build | ||
shell: bash | ||
working-directory: ./starlight | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- 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: ${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:${{ needs.image-tag.outputs.IMAGE_TAG }} | ||
${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:latest | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Update deployment.yaml file | ||
run: | | ||
yq eval '.spec.template.spec.containers[0].image = "${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:${{ needs.image-tag.outputs.IMAGE_TAG }}"' -i manifest/deployment.yaml | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: update deployment.json container image (automated) | ||
|
||
release: | ||
name: Release | ||
needs: [image-tag, deployment] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- id: extract-changelog | ||
uses: sean0x42/[email protected] | ||
with: | ||
file: starlight/CHANGELOG.md | ||
pattern: ${{ needs.image-tag.outputs.IMAGE_TAG }} | ||
|
||
- uses: ncipollo/release-action@v1 | ||
id: create_release | ||
with: | ||
tag: ${{ env.IMAGE_NAME }}-docs@${{ needs.image-tag.outputs.IMAGE_TAG }} | ||
makeLatest: true | ||
body: ${{ steps.extract-changelog.outputs.markdown }} | ||
skipIfReleaseExists: true | ||
|
||
- name: Check if release was created | ||
id: check_release | ||
run: | | ||
if [ -z "${{ steps.create_release.outputs.html_url }}" ]; then | ||
echo "RELEASE_SKIPPED=true" >> $GITHUB_ENV | ||
else | ||
echo "RELEASE_SKIPPED=false" >> $GITHUB_ENV | ||
fi | ||
- name: Discord notification | ||
if: env.RELEASE_SKIPPED == 'false' | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
uses: Ilshidur/[email protected] | ||
with: | ||
args: | | ||
# ${{ env.IMAGE_NAME }}@${{ needs.image-tag.outputs.IMAGE_TAG }} | ||
${{ steps.extract-changelog.outputs.markdown }} |
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,43 @@ | ||
name: Format | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
run_install: | | ||
- recursive: false | ||
args: [--frozen-lockfile] | ||
- args: [--global, prettier, sort-package-json] | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
- name: Sort package.json | ||
run: find . -name "package.json" -not -path "*/node_modules/*" -exec sort-package-json {} \; | ||
- name: Format with Prettier | ||
run: pnpm prettier --write . | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.PUBLIC_GITHUB_TOKEN }} | ||
commit-message: "[ci] format" | ||
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | ||
signoff: false | ||
branch: ci-format | ||
delete-branch: true | ||
title: "[ci] format" | ||
body: "This PR was automatically created to sort package.json files in the repository using sort-package-json and to format the repository using prettier." | ||
labels: 🤖 bot | ||
assignees: trueberryless | ||
draft: false |
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,30 @@ | ||
name: Add tree changes | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
commit-tree-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Write tree outputs to README.md | ||
uses: shirakiya/readme-tree-writer@v2 | ||
with: | ||
config_path: .github/readmetreerc.yaml | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.PUBLIC_GITHUB_TOKEN }} | ||
commit-message: "[ci] update tree" | ||
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | ||
signoff: false | ||
branch: ci-tree | ||
delete-branch: true | ||
title: "[ci] update tree" | ||
body: "This PR was automatically created to update the project structure tree in every `README.md`." | ||
labels: 🤖 bot | ||
assignees: trueberryless | ||
draft: false |
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,40 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
if: ${{ github.repository_owner == 'trueberryless-org' }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PNPM | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: Install Dependencies | ||
run: pnpm i | ||
|
||
- name: Create Release Pull Request | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm run version | ||
commit: "[ci] release" | ||
title: "[ci] release" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }} |
Oops, something went wrong.