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) ) ])