fix: ci 38 #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
# INDONESIA | |
jobs: | |
compile_and_deploy_IND: | |
name: Compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
module: | |
[ | |
P1/PengenalanBahasaC_IND, | |
P2/PerulanganPercabanganArrayString_IND, | |
P3/FungsidanRekursi_IND, | |
P4/PointerdanStruct_IND, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup LaTeX | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: main.tex | |
pre_compile: | | |
sed -i 's|% \\input{'${{ matrix.module }}'.tex|\\input{'${{ matrix.module }}'.tex|' main.tex | |
working_directory: . | |
docker_image: ghcr.io/xu-cheng/texlive-full:20240315 | |
- name: Rename and Move Compiled PDF | |
run: | | |
mkdir -p dist | |
MODULE_NAME="${{matrix.module}}" | |
MODULE_NAME=${MODULE_NAME//\//_} | |
mv main.pdf dist/$MODULE_NAME.pdf | |
echo "MODULE_NAME_SANITIZED=${MODULE_NAME}" >> $GITHUB_ENV | |
- name: Upload Compiled PDF | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: ${{env.MODULE_NAME_SANITIZED}} | |
path: dist | |
compile_and_deploy_ENG: | |
name: Compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
module: | |
[ | |
P1/PengenalanBahasaC_ENG, | |
P2/PerulanganPercabanganArrayString_ENG, | |
P3/FungsidanRekursi_ENG, | |
P4/PointerdanStruct_ENG, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup LaTeX | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: main.tex | |
pre_compile: | | |
sed -i 's|% \\input{'${{ matrix.module }}'.tex|\\input{'${{ matrix.module }}'.tex|' main.tex | |
working_directory: . | |
docker_image: ghcr.io/xu-cheng/texlive-full:20240315 | |
- name: Rename and Move Compiled PDF | |
run: | | |
mkdir -p dist | |
MODULE_NAME="${{matrix.module}}" | |
MODULE_NAME=${MODULE_NAME//\//_} | |
mv main.pdf dist/$MODULE_NAME.pdf | |
echo "MODULE_NAME_SANITIZED=${MODULE_NAME}" >> $GITHUB_ENV | |
- name: Upload Compiled PDF | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: ${{env.MODULE_NAME_SANITIZED}} | |
path: dist | |
merge-artifacts: | |
runs-on: ubuntu-latest | |
needs: [compile_and_deploy_IND, compile_and_deploy_ENG] | |
steps: | |
# Langkah 1: Checkout kode (jika diperlukan) | |
- uses: actions/checkout@v2 | |
# Langkah 2: Mengunduh semua artifacts | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: downloaded-artifacts/ | |
# Langkah 3: Reorganisasi (Opsional) | |
# Anda bisa menambahkan langkah untuk reorganisasi jika perlu | |
- name: Reorganize Artifacts | |
run: | | |
mkdir -p merged-artifacts | |
cp -R downloaded-artifacts/* merged-artifacts/ | |
# Contoh reorganisasi, sesuaikan dengan kebutuhan | |
# Langkah 4: Upload gabungan sebagai artifact baru | |
- name: Upload merged artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: merged-artifact | |
path: merged-artifacts/ |