Update main.yml #160
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: gh-pages | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TARGET_DIR: /target | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Dioxus Deploy | |
uses: DioxusLabs/[email protected] | |
id: deployment | |
continue-on-error: true | |
- name: Check Deployment Status | |
if: steps.deployment.outcome != 'success' | |
run: | | |
echo "Deployment failed" | |
exit 1 | |
deploy-resume: | |
needs: build | |
runs-on: ubuntu-latest | |
if: success() | |
steps: | |
- name: Download Resume | |
run: | | |
curl -sSL -o resume.pdf https://raw.githubusercontent.com/MH0386/MH0386/main/resume.pdf | |
if [ ! -f resume.pdf ]; then | |
echo "Failed to download resume" | |
exit 1 | |
fi | |
continue-on-error: true | |
- name: Configure Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
- name: Commit and Push Resume | |
run: | | |
git checkout gh-pages || (echo "Failed to checkout gh-pages branch" && exit 1) | |
if [ ! -f resume.pdf ]; then | |
echo "Resume file not found" | |
exit 1 | |
fi | |
git add resume.pdf | |
git commit -m "Add My Resume" || echo "No changes to commit" | |
git push || (echo "Failed to push changes" && exit 1) |