Project import from github
This commit is contained in:
commit
0add58254d
179 changed files with 23756 additions and 0 deletions
120
.forgejo/workflows/production-build.yml
Normal file
120
.forgejo/workflows/production-build.yml
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
name: Production Build and Deploy
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- production
|
||||
env:
|
||||
FORGEJO_HOST: git.burcusel.nl
|
||||
CONTAINER_NAME: glowing-fiesta
|
||||
OWNER: public
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: node24
|
||||
steps:
|
||||
- name: Setup Node environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
NUXT_PUBLIC_SITE_URL: ${{ vars.NUXT_PUBLIC_SITE_URL }}
|
||||
DATABASE_URL: "N/A"
|
||||
BETTER_AUTH_SECRET: "N/A"
|
||||
BETTER_AUTH_URL: "N/A"
|
||||
- name: Run tests and generate coverage
|
||||
run: npm run coverage
|
||||
# continue-on-error: true
|
||||
# env:
|
||||
# CI: true
|
||||
- name: SonarQube Scan
|
||||
uses: https://github.com/SonarSource/sonarqube-scan-action@v6
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
- name: Build site
|
||||
env:
|
||||
NITRO_PRESET: node_cluster
|
||||
NUXT_PUBLIC_SITE_URL: ${{ vars.NUXT_PUBLIC_SITE_URL }}
|
||||
DATABASE_URL: "N/A"
|
||||
BETTER_AUTH_SECRET: "N/A"
|
||||
BETTER_AUTH_URL: "N/A"
|
||||
run: npm run build
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: output
|
||||
path: .output/
|
||||
overwrite: true
|
||||
include-hidden-files: true
|
||||
deploy:
|
||||
name: Deploy
|
||||
needs: build
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Setup environment
|
||||
run: |
|
||||
apk --no-cache add --update nodejs npm curl
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Prepare environment variables
|
||||
id: prepare-env
|
||||
run: |
|
||||
echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV
|
||||
echo CONTAINER_NAME=${{ env.CONTAINER_NAME }} >> $GITHUB_ENV
|
||||
echo VERSION=$(node -p "require('./package.json').version")
|
||||
echo VERSION=$(node -p "require('./package.json').version") >> "$GITHUB_OUTPUT"
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: output
|
||||
path: ./output
|
||||
- name: Login to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.PACKAGING_TOKEN }}
|
||||
# - name: Build and push
|
||||
# uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: context
|
||||
# push: true
|
||||
# provenance: false
|
||||
# tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest
|
||||
|
||||
# - name: check docker
|
||||
# run: |
|
||||
# docker --version
|
||||
# docker info
|
||||
- name: Build Docker image and push
|
||||
run: |
|
||||
echo [${{ env.CONTAINER_NAME }}:"${{ steps.prepare-env.outputs.VERSION }}", ${{ env.CONTAINER_NAME }}:latest]
|
||||
docker build -f ./devops/Dockerfile -t ${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }} -t ${{ env.CONTAINER_NAME }}:latest .
|
||||
docker image tag ${{ env.CONTAINER_NAME }}:latest ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:latest
|
||||
docker image push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:latest
|
||||
docker image tag ${{ env.CONTAINER_NAME }}:latest ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }}
|
||||
docker image push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.CONTAINER_NAME }}:${{ steps.prepare-env.outputs.VERSION }}
|
||||
- name: Server deploy
|
||||
uses: https://git.burcusel.nl/public/ssh-action@v1.2.6
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
key: ${{ secrets.DEPLOY_KEY }}
|
||||
script: |
|
||||
cd /opt/glowing-fiesta
|
||||
docker compose down
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
|
||||
####
|
||||
43
.forgejo/workflows/production-pr.yml
Normal file
43
.forgejo/workflows/production-pr.yml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
name: Production PR
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- production
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
qa-tests:
|
||||
name: QA Tests
|
||||
runs-on: node24
|
||||
steps:
|
||||
- name: Setup Node environment
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
NUXT_PUBLIC_SITE_URL: ${{ vars.NUXT_PUBLIC_SITE_URL }}
|
||||
DATABASE_URL: "N/A"
|
||||
BETTER_AUTH_SECRET: "N/A"
|
||||
BETTER_AUTH_URL: "N/A"
|
||||
- name: Run tests and generate coverage
|
||||
run: npm run coverage
|
||||
# continue-on-error: true
|
||||
# env:
|
||||
# CI: true
|
||||
- name: SonarQube Scan
|
||||
uses: https://github.com/SonarSource/sonarqube-scan-action@v6
|
||||
with:
|
||||
args: >
|
||||
"-Dsonar.projectKey=GF-dev"
|
||||
"-Dsonar.projectName=Glowing Fiesta (dev)"
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue