-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from DevopsGroupC/feature/178-automate-report…
…-building *** Squashed 66 commits of trial and error ***
- Loading branch information
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Build Report | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build_latex: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
ssh-key: ${{ secrets.DEPLOY_KEY_FOR_REPORT_PRIVATE }} | ||
|
||
- name: Update submodules | ||
run: | | ||
git submodule update --init --recursive --remote | ||
- name: Set up LaTeX | ||
uses: xu-cheng/latex-action@v3 | ||
with: | ||
working_directory: report | ||
root_file: main.tex | ||
|
||
- name: Move main.pdf | ||
run: | | ||
cd report | ||
mv -f main.pdf ./build | ||
- name: Setup SSH for pushing to report repository | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.DEPLOY_KEY_FOR_REPORT_PRIVATE }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
- name: Commit and push main.pdf | ||
run: | | ||
cd report | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git submodule update --remote | ||
git add build/main.pdf | ||
git commit -m "Update report PDF" | ||
git remote set-url origin [email protected]:DevopsGroupC/report.git | ||
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push -f origin main | ||
- name: Setup SSH for pushing to main repository | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.DEPLOY_KEY_FOR_MINITWIT_PRIVATE }}" > ~/.ssh/id_minitwit_rsa | ||
chmod 600 ~/.ssh/id_minitwit_rsa | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
- name: Update submodule reference and push | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git fetch origin | ||
git reset --hard origin/develop | ||
git submodule update --remote | ||
git checkout -b update-report-pdf | ||
git add report | ||
git commit -m "Update submodule reference to latest commit" | ||
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_minitwit_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push -f --set-upstream origin update-report-pdf |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "report"] | ||
path = report | ||
url = https://github.com/DevopsGroupC/report |