Skip to content

Commit

Permalink
push resume to website
Browse files Browse the repository at this point in the history
  • Loading branch information
andreykaipov committed Mar 19, 2024
1 parent abb847d commit e1b48d0
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions .github/workflows/resume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ on:

env:
tectonic_version: 0.15.0
commit_message: "gh-actions: add resume.pdf"
commit_message_resume: "gh-actions: add resume.pdf"

jobs:
build:
runs-on: ubuntu-latest
outputs:
leave-comment: ${{ steps.push.outputs.committed && steps.push.outputs.pushed }}
msg: ${{ steps.build.outputs.msg }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -43,33 +43,39 @@ jobs:
id: build
run: |
./scripts/build.sh
# TODO: push final pdf to website repo
- name: Push that bitch up
id: push
if: ${{ success() }}
uses: EndBug/[email protected]
with:
add: resume.pdf
push: true
message: ${{ env.commit_message }}
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com

echo "msg=${{ env.commit_message_resume }}" >>$GITHUB_OUTPUT
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: resume # it'll be zipped :(
path: resume.pdf

# - name: Leave a comment
# if: |
# success() &&
# steps.push.outputs.committed == 'true' &&
# steps.push.outputs.pushed == 'true'
# uses: mshick/add-pr-comment@v1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# repo-token-user-login: github-actions[bot]
# message: |
# ${{ env.commit_message_resume }}
update-website:
runs-on: ubuntu-latest
needs: [build]
if: ${{ needs.build.outputs.msg != '' }}
steps:
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.CATHY_CLOUD_APP_ID }}
private_key: ${{ secrets.CATHY_CLOUD_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
repository: andreykaipov/website
path: website
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Create website PR
id: website-pr
run: |
mv resume.pdf website
cd website
git checkout -b auto/resume
git add .
git commit -m "${{ needs.build.outputs.build.outputs.msg }}"
git push origin auto/resume
pr=$(gh pr create --title "Update resume.pdf" --body "Automatically generated by GitHub Actions")
echo pr=$pr >>$GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

0 comments on commit e1b48d0

Please sign in to comment.