mirror of
https://github.com/XFox111/bonch-calendar.git
synced 2026-04-22 07:08:01 +03:00
init: initial commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
name: "Audit pipeline"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '.devcontainer/*'
|
||||
- '.github/*'
|
||||
- '!.github/workflows/audit.yml'
|
||||
- '.vscode/*'
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
- 'assets/*'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '.devcontainer/*'
|
||||
- '.github/*'
|
||||
- '!.github/workflows/audit.yml'
|
||||
- '.vscode/*'
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
- 'assets/*'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./api
|
||||
tags: ${{ github.repository }}-api:ci
|
||||
|
||||
- run: docker save ${{ github.repository }}:ci | gzip > api_image.tar.gz
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: api-image
|
||||
path: api_image.tar.gz
|
||||
|
||||
app:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./app
|
||||
tags: ${{ github.repository }}-app:ci
|
||||
|
||||
- run: docker save ${{ github.repository }}:ci | gzip > app_image.tar.gz
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: app-image
|
||||
path: app_image.tar.gz
|
||||
|
||||
app_audit:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- run: npm install
|
||||
working-directory: ./app
|
||||
|
||||
- run: npm run lint
|
||||
working-directory: ./app
|
||||
|
||||
- run: npm audit --audit-level=moderate
|
||||
working-directory: ./app
|
||||
|
||||
- run: npm audit --audit-level=moderate --json > audit_report.json
|
||||
working-directory: ./app
|
||||
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: app-audit-report
|
||||
path: ./app/audit_report.json
|
||||
@@ -0,0 +1,110 @@
|
||||
name: "Release pipeline"
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: |
|
||||
${{ github.repository }}-api
|
||||
ghcr.io/${{ github.repository }}-api
|
||||
tags: |
|
||||
latest
|
||||
${{ github.ref_name }}
|
||||
|
||||
- name: "Login to Docker Hub"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: "Login to GitHub Container Registry"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./api
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
app:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: |
|
||||
${{ github.repository }}-app
|
||||
ghcr.io/${{ github.repository }}-app
|
||||
tags: |
|
||||
latest
|
||||
${{ github.ref_name }}
|
||||
|
||||
- name: "Login to Docker Hub"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: "Login to GitHub Container Registry"
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./app
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
pages:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:latest
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- run: npm install
|
||||
working-directory: ./app
|
||||
|
||||
- run: npm run build
|
||||
env:
|
||||
VITE_BACKEND_HOST: https://api.bonch.xfox111.net
|
||||
working-directory: ./app
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: "./app/dist"
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
Reference in New Issue
Block a user