From 14cc4886c1dac9762329c5ea04017ccda9944542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=9F=D1=80=D1=83=D1=81=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Wed, 10 May 2023 03:31:35 +0300 Subject: [PATCH] fix deploy --- .github/workflows/swift.yml | 9 +++------ Sources/AdaEngineWebsite/main.swift | 9 +-------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 4b419ce..51042ae 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -1,6 +1,5 @@ name: Deploy website -# This workflow is triggered on pushes to the repository. on: push: branches: [ main ] @@ -9,18 +8,16 @@ permissions: contents: write jobs: - build: - name: Deploy AdaEngine Website - + build-and-deploy-website: runs-on: macos-latest - steps: - uses: actions/checkout@v2 + - name: Generate static site run: swift run AdaEngineWebsite --deploy - name: Deploy to GitHub Pages - - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@v4 with: branch: main folder: Output diff --git a/Sources/AdaEngineWebsite/main.swift b/Sources/AdaEngineWebsite/main.swift index e1eb8f5..b5b58d4 100644 --- a/Sources/AdaEngineWebsite/main.swift +++ b/Sources/AdaEngineWebsite/main.swift @@ -61,13 +61,6 @@ enum Constants { static let stylesPath: Path = "Resources/Styles" } -// we publish site from CI -let environment = ProcessInfo.processInfo.environment["DEPLOY_ACCESS_TOKEN"] - -let deploymentMethod: DeploymentMethod = environment.flatMap { token in - .git("https://x-access-token:\(token)@github.com/AdaEngine/adaengine.github.io.git", branch: "main") -} ?? .gitHub("AdaEngine/adaengine.github.io", branch: "main", useSSH: true) // otherwise we publish from local machine - // This will generate your website using the built-in Foundation theme: try Blog().publish(using: [ // To parse date from markdown files @@ -118,7 +111,7 @@ try Blog().publish(using: [ .generateRSSFeed(including: [.blog]), .generateSiteMap(), .deploy( - using: deploymentMethod + using: .gitHub("AdaEngine/adaengine.github.io", branch: "main", useSSH: true) ) ])