Skip to content

Commit

Permalink
re: make GitHub Actions setup easier for forks
Browse files Browse the repository at this point in the history
  • Loading branch information
cybardev committed Jan 29, 2024
1 parent 286438b commit cb5a468
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,13 @@ name: Build and Publish Pipeline

on:
push:
# TODO: uncomment the following line on forks
# branches: main

# TODO: remove the following line on forks
tags: "v*"

jobs:
generate-resume:
name: Generate Resume
uses: ./.github/workflows/resume.yml

publish-site:
name: Publish Site
needs: generate-resume
if: needs.generate-resume.outputs.skip == 'false'
uses: ./.github/workflows/website.yml

# TODO: remove the following two workflow calls on forks
update-resume:
name: Update Resume
if: github.repository == 'cybardev/resumake'
uses: ./.github/workflows/update-resume.yml

publish-package:
name: Publish to PyPI
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/update-resume.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update Resume

on:
# TODO: uncomment the following 3 lines on forks
# push:
# branches: main
# paths: "resume/*.py"

# Allows running this workflow from other workflows
workflow_call:

# Allows running this workflow from GitHub Actions tab
workflow_dispatch:

jobs:
generate-resume:
name: Generate Resume
uses: ./.github/workflows/resume.yml

publish-site:
name: Publish Site
needs: generate-resume
if: needs.generate-resume.outputs.skip == 'false'
uses: ./.github/workflows/website.yml
3 changes: 1 addition & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ concurrency:
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
publish-site:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ options:

- fork this repo
- navigate to your fork
- edit [`.github/workflows/main.yml`][main_yml] according to the `TODO` comments inside the file
- edit [`.github/workflows/update-resume.yml`][workflow_yml] according to the `TODO` comments inside the file
- rename [`resume/cybardev.py`][resume_py] to have your GitHub username instead of `cybardev`
- modify the renamed Python file to include your resume info
- push changes to your fork
Expand Down Expand Up @@ -134,6 +134,6 @@ docker pull cybardev/resumake
<!-- links -->
[main_yml]: .github/workflows/main.yml
[workflow_yml]: .github/workflows/update-resume.yml
[resume_py]: https://github.com/cybardev/resumake/blob/main/resume/cybardev.py
[resume_png]: https://raw.githubusercontent.com/cybardev/resumake/main/static/assets/Resume_Sheikh_Saad_Abdullah.png "Resume - Sheikh Saad Abdullah"

0 comments on commit cb5a468

Please sign in to comment.