Skip to content

Commit a1280a0

Browse files
committed
chore: commit inicial
0 parents  commit a1280a0

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Exportação de Exercícios
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-commit-links:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
# 1. Baixa o código do repositório
15+
- name: Checkout Repository
16+
uses: actions/checkout@v3
17+
18+
# 2. Gera o arquivo de links agrupados
19+
- name: Generate Grouped Links
20+
run: |
21+
echo "## Links para os Exercícios" > links.md
22+
echo "" >> links.md
23+
for bloco_dir in */; do
24+
if [ -d "${bloco_dir}" ]; then
25+
bloco_name=$(basename "${bloco_dir}" | sed -e 's/^[0-9]*-//' -e 's/-/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2);}1')
26+
echo "## 📖 $bloco_name" >> links.md
27+
echo "" >> links.md
28+
for disciplina_dir in "${bloco_dir}"*/; do
29+
if [ -d "${disciplina_dir}" ]; then
30+
disciplina_name=$(basename "${disciplina_dir}" | sed -e 's/^[0-9,.]*-//' -e 's/-/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2);}1')
31+
echo "### 📂 $disciplina_name" >> links.md
32+
find "${disciplina_dir}" -maxdepth 1 -type d -name "DR*-TP*.*" | sort | while read exercicio_path; do
33+
exercicio_name=$(basename "${exercicio_path}")
34+
clean_path="${exercicio_path#./}"
35+
echo "* **${exercicio_name}** &rarr; [Abrir no CodeSandbox](https://codesandbox.io/s/github/${{ github.repository_owner }}/${{ github.event.repository.name }}/tree/main/${clean_path})" >> links.md
36+
done
37+
echo "" >> links.md
38+
fi
39+
done
40+
fi
41+
done
42+
43+
# 3. Atualiza o README.md usando a âncora
44+
- name: Update README.md
45+
run: |
46+
# Verifica se as âncoras existem, se não existir, adiciona elas
47+
if ! grep -q "<!-- START_GENERATED_LINKS -->" README.md; then
48+
echo "" >> README.md
49+
echo "<!-- START_GENERATED_LINKS -->" >> README.md
50+
echo "<!-- END_GENERATED_LINKS -->" >> README.md
51+
fi
52+
53+
# Cria um arquivo temporário com o novo conteúdo
54+
{
55+
sed '/<!-- START_GENERATED_LINKS -->/q' README.md
56+
cat links.md
57+
sed -n '/<!-- END_GENERATED_LINKS -->/,$p' README.md
58+
} > README_temp.md
59+
60+
# Substitui o README original pelo temporário
61+
mv README_temp.md README.md
62+
63+
# 4. Faz o commit e push das alterações no README.md
64+
- name: Commit and Push changes
65+
uses: stefanzweifel/git-auto-commit-action@v4
66+
with:
67+
commit_message: "docs(automação): Atualização dos índices de exercícios no README.md"
68+
file_pattern: "README.md"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
teste2
10+
</body>
11+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
testeeee
10+
</body>
11+
</html>

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Caderno de Exercícios
2+
3+
Este repositório contém os exercícios realizados para o curso de Engenharia de Software no Instituto Infnet realizados por mim.
4+
Cada um possui um respectivo diretório no CodeSandbox para o seu compartilhamento com os docentes.
5+
6+
## Como Usar
7+
8+
1. Navegue pelos diretórios organizados por bloco e disciplina
9+
2. Cada exercício possui um link direto para o CodeSandbox
10+
3. Os links são atualizados automaticamente via GitHub Actions
11+
12+
<!-- START_GENERATED_LINKS -->
13+
## Links para os Exercícios
14+
15+
## 📖 Desenvolvimento Front End
16+
17+
### 📂 DR1 Mobile First Ui
18+
19+
### 📂 DR2 Fundamentos De React
20+
* **DR2-TP1.01** &rarr; [Abrir no CodeSandbox](https://codesandbox.io/s/github/mattolivr/infnet/tree/main/2-desenvolvimento-front-end/DR2-fundamentos-de-react/DR2-TP1.01)
21+
22+
<!-- END_GENERATED_LINKS -->

0 commit comments

Comments
 (0)