Skip to content

Commit

Permalink
fix: contributors not appear
Browse files Browse the repository at this point in the history
  • Loading branch information
trindadedev13 committed Jan 29, 2025
1 parent 216fd6e commit 9495867
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create .env file
run: |
echo "GITHUB_TOKEN=${{ secrets.SUPER_TOKEN}}" > .env
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<link href="https://fonts.cdnfonts.com/css/dt-getai-grotesk-display" rel="stylesheet">

<link href="styles.css" rel="stylesheet">

<script src="scripts.js"></script>
</head>

<body>
Expand Down Expand Up @@ -84,14 +86,15 @@ <h2 style="font-family: 'DT Getai Grotesk Display', sans-serif;">A Terminal from
</div>
</div>
</body>
<footer style="margin :30px; ">
<h1 style="text-align :center ">Contributors</h1>
<a href="https://github.com/Robok-Engine/Robok-Engine/graphs/contributors">
<img width="310px" src="https://contrib.rocks/image?repo=Robok-Engine/Robok-Engine" />
<footer style="margin: 30px;">
<h1 style="text-align: center;">Contributors</h1>
<a href="https://github.com/Robok-Engine/Robok-Engine/graphs/contributors" target="_blank">
<img id="contributorsImage" width="310px" src="https://contrib.rocks/image?repo=Robok-Engine/Robok-Engine" alt="Contributors" />
<br>

</a>
<h4> Website is Made by </h4><a herf="https://github.com/syntaxspins">SyntaxSpin</a>
<h4>Website is Made by</h4>
<a href="https://github.com/syntaxspins" target="_blank">SyntaxSpin</a>
<h4>for The Robok Community</h4>
</footer>

</html>
30 changes: 30 additions & 0 deletions scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
async function fetchContributors() {
const token = process.env.GITHUB_TOKEN;
const repo = 'Robok-Engine/Robok-Engine';

try {
const response = await fetch(`https://raw.githubusercontent.com/Robok-Engine/Robok-Engine/host/.github/contributors/contributors_github.json`, {
headers: {
'Authorization': `token ${token}`
}
});
const data = await response.json();

if (response.ok) {
const contributorsList = data.map(contributor => {
return `<li><a href="https://github.com/${contributor.login}" target="_blank">${contributor.login}</a></li>`;
}).join('');

const contributorsContainer = document.createElement('ul');
contributorsContainer.innerHTML = contributorsList;

document.body.appendChild(contributorsContainer);
} else {
console.error('Failed to fetch contributors:', data);
}
} catch (error) {
console.error('Error fetching contributors:', error);
}
}

fetchContributors();

0 comments on commit 9495867

Please sign in to comment.