From d470e02a2eb138fabf345db8b0edca443873b587 Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 13 Jun 2025 23:21:36 +0900 Subject: [PATCH] fix gh-actions --- .github/workflows/deploy.yml | 62 ------------------------------ .github/workflows/pages-simple.yml | 61 ----------------------------- 2 files changed, 123 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/pages-simple.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index acf4412..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Deploy ailog - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Cache cargo registry - uses: actions/cache@v3 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@v3 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo build - uses: actions/cache@v3 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - - name: Build ailog - run: cargo build --release - - - name: Generate static site - run: | - ./target/release/ailog build my-blog - touch my-blog/public/.nojekyll - - - name: Setup Cloudflare Pages - run: | - # Cloudflare Pages用の設定 - echo '/* /index.html 200' > my-blog/public/_redirects - echo 'X-Frame-Options: DENY' > my-blog/public/_headers - echo 'X-Content-Type-Options: nosniff' >> my-blog/public/_headers - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./my-blog/public - publish_branch: gh-pages \ No newline at end of file diff --git a/.github/workflows/pages-simple.yml b/.github/workflows/pages-simple.yml deleted file mode 100644 index 5cf060d..0000000 --- a/.github/workflows/pages-simple.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Deploy Blog to Cloudflare Pages - -on: - push: - branches: [ main ] - workflow_dispatch: - -env: - NODE_VERSION: '20' - HUGO_VERSION: '0.139.2' - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'npm' - cache-dependency-path: oauth/package-lock.json - - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: ${{ env.HUGO_VERSION }} - extended: true - - - name: Build OAuth components - run: | - cd oauth - npm ci - npm run build - - - name: Integrate OAuth with Hugo - run: | - # Create oauth directory in static - mkdir -p my-blog/static/oauth - - # Copy built assets - cp -r oauth/dist/assets/* my-blog/static/assets/ 2>/dev/null || true - cp oauth/dist/index.html my-blog/static/oauth/ 2>/dev/null || true - cp oauth/dist/client-metadata.json my-blog/static/ 2>/dev/null || true - - - name: Build Hugo site - run: | - cd my-blog - TZ=Asia/Tokyo hugo --minify - - - name: Deploy to Cloudflare Pages - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: ai-log # または ${{ secrets.CLOUDFLARE_PROJECT_NAME }} - directory: my-blog/public - gitHubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file