-
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #107 from studentinovisad/as/ci/cicd
chore: CI/CD and goodies
- Loading branch information
Showing
6 changed files
with
188 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 @@ | ||
liberapay: studentinovisad |
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,44 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '[BUG]' | ||
labels: 'bug' | ||
assignees: '' | ||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**What's your setup? (please complete the following information):** | ||
|
||
- Version of the software [e.g. 1.2.3] | ||
- Method of installation [e.g. docker] | ||
|
||
**Docker compose file if used** | ||
|
||
```yaml | ||
# Your docker-compose.prod.yml goes here | ||
``` | ||
|
||
**Your .env file without secrets** | ||
|
||
```env | ||
YOUR_DOT_ENV_GOES_HERE= | ||
``` | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,16 @@ | ||
--- | ||
name: Feature request | ||
about: Ask for adding a new feature | ||
title: '[FEAT]' | ||
labels: 'enhancement' | ||
assignees: '' | ||
--- | ||
|
||
**Describe your feature request** | ||
A clear and concise description of what the feature request is. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your request. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
- package-ecosystem: 'docker' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
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,74 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
tags: ['v*.*.*'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
IMAGE_NAME_POSTGRES: ${{ github.repository }}-postgres | ||
|
||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
PUBLIC_UI_VERSION: ${{ github.ref }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64,arm | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: docker/login-action@v3 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/node.Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: |- | ||
linux/amd64 | ||
linux/arm64 | ||
linux/arm/v7 | ||
- uses: docker/metadata-action@v5 | ||
id: meta_postgres | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_POSTGRES }} | ||
|
||
- uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/postgres.Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta_postgres.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: |- | ||
linux/amd64 | ||
linux/arm64 | ||
linux/arm/v7 |
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,39 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
env: | ||
PUBLIC_UI_VERSION: ${{ github.ref }} | ||
STAGE: build # Ugly workaround some build bug that tries to connect to the DB while bundling | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Svelte check | ||
run: pnpm run check | ||
|
||
- name: Prettier and eslint checks | ||
run: pnpm run lint |