mirror of
https://gitlab.com/Anson-Projects/projects.git
synced 2025-09-19 03:52:37 +00:00
Compare commits
2 Commits
a6dd33ce5f
...
cf5021e682
Author | SHA1 | Date | |
---|---|---|---|
cf5021e682 | |||
54f2a1bc53 |
@@ -2,6 +2,12 @@ publish:
|
||||
stage: deploy
|
||||
image: rust:latest
|
||||
script:
|
||||
- echo "Listing project root directory:"
|
||||
- ls -la
|
||||
- echo "Listing public directory:"
|
||||
- ls -la public/ || echo "public directory not found"
|
||||
- echo "Looking for index.xml:"
|
||||
- find . -name "index.xml" -type f || echo "No index.xml files found"
|
||||
- cd ./ghost-upload
|
||||
- cargo run
|
||||
needs:
|
||||
|
@@ -227,10 +227,38 @@ async fn get_existing_post_id(slug: &str, token: &str) -> Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
async fn fetch_feed(url: &str) -> Vec<Entry> {
|
||||
let content = reqwest::get(url).await.unwrap().text().await.unwrap();
|
||||
async fn fetch_feed(path: &str) -> Vec<Entry> {
|
||||
// Debug: Print current directory and list files
|
||||
if let Ok(current_dir) = std::env::current_dir() {
|
||||
eprintln!("Current directory: {:?}", current_dir);
|
||||
}
|
||||
|
||||
let feed = parser::parse(content.as_bytes()).unwrap();
|
||||
// Debug: List files in parent directory
|
||||
if let Ok(entries) = std::fs::read_dir("..") {
|
||||
eprintln!("Files in parent directory:");
|
||||
for entry in entries {
|
||||
if let Ok(entry) = entry {
|
||||
eprintln!(" {:?}", entry.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Debug: Check if public directory exists
|
||||
if let Ok(entries) = std::fs::read_dir("../public") {
|
||||
eprintln!("Files in ../public:");
|
||||
for entry in entries {
|
||||
if let Ok(entry) = entry {
|
||||
eprintln!(" {:?}", entry.path());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
eprintln!("../public directory does not exist or cannot be read");
|
||||
}
|
||||
|
||||
// Read from local file instead of HTTP request
|
||||
let content = std::fs::read_to_string(path).expect("Failed to read RSS feed file");
|
||||
|
||||
let feed = parser::parse(content.as_bytes()).expect("Failed to parse RSS feed");
|
||||
|
||||
feed.entries
|
||||
}
|
||||
@@ -296,7 +324,7 @@ async fn main() {
|
||||
|
||||
|
||||
|
||||
let feed = "https://projects.ansonbiggs.com/index.xml";
|
||||
let feed = "../public/index.xml";
|
||||
|
||||
// Split the key into ID and SECRET
|
||||
let (id, secret) = ghost_admin_api_key
|
||||
|
Reference in New Issue
Block a user