Skip to content

Commit

Permalink
fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectralDragon committed May 10, 2023
1 parent db70bf1 commit 14cc488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Deploy website

# This workflow is triggered on pushes to the repository.
on:
push:
branches: [ main ]
Expand All @@ -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
Expand Down
9 changes: 1 addition & 8 deletions Sources/AdaEngineWebsite/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Blog> = 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
Expand Down Expand Up @@ -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)
)
])

Expand Down

0 comments on commit 14cc488

Please sign in to comment.