chore(ci/cd): adjust workflows ci/cd files to work with actions/cache
This commit is contained in:
@@ -1,127 +1,42 @@
|
||||
name: Deploy
|
||||
|
||||
name: Deploy Pipeline
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
description: 'Deployment environment'
|
||||
description: 'Target'
|
||||
required: true
|
||||
default: 'production'
|
||||
type: choice
|
||||
options:
|
||||
- staging
|
||||
- production
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
options: [staging, production]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to ${{ github.event.inputs.environment || 'production' }}
|
||||
pipeline:
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: ${{ github.event.inputs.environment || 'production' }}
|
||||
|
||||
# Only deploy after successful linting, testing, and building
|
||||
needs: [lint, test, build]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Install
|
||||
run: yarn install --frozen-lockfile --prefer-offline
|
||||
|
||||
- name: Build project
|
||||
- name: Validation
|
||||
run: |
|
||||
yarn oxlint .
|
||||
yarn svelte-check
|
||||
|
||||
- name: Build for Production
|
||||
run: yarn build
|
||||
env:
|
||||
NODE_ENV: production
|
||||
|
||||
# Example deployment step - replace with your actual deployment strategy
|
||||
# Options:
|
||||
# - Docker container registry
|
||||
# - Cloud provider (AWS, GCP, Azure)
|
||||
# - Traditional hosting (Vercel, Netlify, Cloudflare Pages)
|
||||
# - SSH deployment to VPS
|
||||
|
||||
# Example: Docker image build and push
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v3
|
||||
|
||||
# - name: Log in to Container Registry
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# registry: ${{ secrets.REGISTRY_URL }}
|
||||
# username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
# password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
# - name: Build and push Docker image
|
||||
# uses: docker/build-push-action@v5
|
||||
# with:
|
||||
# context: .
|
||||
# push: true
|
||||
# tags: ${{ secrets.REGISTRY_URL }}/glyphdiff:latest
|
||||
# cache-from: type=gha
|
||||
# cache-to: type=gha,mode=max
|
||||
|
||||
# Example: SSH deployment to server
|
||||
# - name: Deploy to server via SSH
|
||||
# uses: appleboy/ssh-action@v1.0.3
|
||||
# with:
|
||||
# host: ${{ secrets.DEPLOY_HOST }}
|
||||
# username: ${{ secrets.DEPLOY_USER }}
|
||||
# key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
# script: |
|
||||
# cd /path/to/app
|
||||
# git pull origin main
|
||||
# yarn install --frozen-lockfile
|
||||
# yarn build
|
||||
# pm2 restart glyphdiff
|
||||
|
||||
# Example: Deploy to Vercel
|
||||
# - name: Deploy to Vercel
|
||||
# uses: amondnet/vercel-action@v25
|
||||
# with:
|
||||
# vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
||||
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
||||
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
# vercel-args: '--prod'
|
||||
|
||||
- name: Deployment placeholder
|
||||
- name: Deploy Step
|
||||
run: |
|
||||
echo "Deployment step not configured yet."
|
||||
echo "Uncomment and modify one of the deployment examples above."
|
||||
echo "Configure the necessary secrets in your Gitea instance:"
|
||||
echo " - REGISTRY_URL, REGISTRY_USERNAME, REGISTRY_PASSWORD"
|
||||
echo " - DEPLOY_HOST, DEPLOY_USER, DEPLOY_SSH_KEY"
|
||||
echo " - VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID"
|
||||
|
||||
- name: Post-deployment health check
|
||||
run: |
|
||||
echo "Add health check here after deployment"
|
||||
# curl -f https://your-app.com || exit 1
|
||||
|
||||
lint:
|
||||
name: Lint Check
|
||||
uses: ./.gitea/workflows/lint.yml
|
||||
secrets: inherit
|
||||
|
||||
test:
|
||||
name: Test Suite
|
||||
uses: ./.gitea/workflows/test.yml
|
||||
secrets: inherit
|
||||
|
||||
build:
|
||||
name: Build Verification
|
||||
uses: ./.gitea/workflows/build.yml
|
||||
secrets: inherit
|
||||
echo "Deploying dist/ to ${{ github.event.inputs.environment || 'production' }}..."
|
||||
# EXAMPLE: rsync -avz dist/ user@your-vps:/var/www/html/
|
||||
|
||||
Reference in New Issue
Block a user