Updated python resume 15 Jan 2024 #107
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 workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Deployment | |
on: | |
release: | |
types: [published] | |
branches: [master] | |
pull_request: | |
branches: [master] | |
push: | |
branches: [master] | |
jobs: | |
deploy-website: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Packaging | |
run: | | |
npm ci | |
npm run build --if-present | |
- name: Firebase deployment | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
run: | | |
npm run notify-deployment | |
npm run deploy | |
upload-resume: | |
runs-on: ubuntu-latest | |
env: | |
DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Dropbox resume docx upload | |
env: | |
RESUME_DOCX_LOC: "docs/assets" | |
run: | | |
sudo apt-get install jq | |
echo "Uploading resume.docx to dropbox" | |
curl -X POST https://content.dropboxapi.com/2/files/upload \ | |
--header "Authorization: Bearer ${DROPBOX_ACCESS_TOKEN}" \ | |
--header "Dropbox-API-Arg: {\"path\": \"/alpha/resume.docx\",\"mode\": \"overwrite\",\"autorename\": false,\"mute\": false,\"strict_conflict\": false}" \ | |
--header "Content-Type: application/octet-stream" \ | |
--data-binary "@${RESUME_DOCX_LOC}/resume.docx" | jq | |
echo "Uploading resume-python.docx to dropbox" | |
curl -X POST https://content.dropboxapi.com/2/files/upload \ | |
--header "Authorization: Bearer ${DROPBOX_ACCESS_TOKEN}" \ | |
--header "Dropbox-API-Arg: {\"path\": \"/alpha/resume-python.docx\",\"mode\": \"overwrite\",\"autorename\": false,\"mute\": false,\"strict_conflict\": false}" \ | |
--header "Content-Type: application/octet-stream" \ | |
--data-binary "@${RESUME_DOCX_LOC}/resume-python.docx" | jq | |
- name: Create resume pdf and upload to fzbot branch | |
env: | |
RESUME_DOCX_LOC: "docs/assets" | |
run: | | |
sudo apt-get install unoconv --fix-missing -y | |
echo "Dependencies installed" | |
git config user.email afzalex.store@gmail.com | |
git config user.name "afzalex bot" | |
git checkout -b fzbot | |
git reset --hard master | |
doc2pdf "${RESUME_DOCX_LOC}/resume.docx" | |
doc2pdf "${RESUME_DOCX_LOC}/resume-python.docx" | |
git add * | |
git commit -m "Added pdf versions of resumes" | |
git fetch | |
git branch --set-upstream-to=origin/fzbot fzbot | |
git push -f | |
- name: Dropbox resume pdf upload | |
env: | |
RESUME_PDF_LOC: "docs/assets" | |
run: | | |
sudo apt-get install jq | |
git fetch | |
git checkout fzbot | |
echo "Uploading resume.pdf to dropbox" | |
curl -X POST https://content.dropboxapi.com/2/files/upload \ | |
--header "Authorization: Bearer ${DROPBOX_ACCESS_TOKEN}" \ | |
--header "Dropbox-API-Arg: {\"path\": \"/alpha/resume.pdf\",\"mode\": \"overwrite\",\"autorename\": false,\"mute\": false,\"strict_conflict\": false}" \ | |
--header "Content-Type: application/octet-stream" \ | |
--data-binary "@${RESUME_PDF_LOC}/resume.pdf" | jq | |
echo "Uploading resume.pdf to dropbox" | |
curl -X POST https://content.dropboxapi.com/2/files/upload \ | |
--header "Authorization: Bearer ${DROPBOX_ACCESS_TOKEN}" \ | |
--header "Dropbox-API-Arg: {\"path\": \"/alpha/resume-python.pdf\",\"mode\": \"overwrite\",\"autorename\": false,\"mute\": false,\"strict_conflict\": false}" \ | |
--header "Content-Type: application/octet-stream" \ | |
--data-binary "@${RESUME_PDF_LOC}/resume-python.pdf" | jq | |
replicate-to-afzalex: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install curl | |
sudo apt-get install expect | |
- name: Replicating README | |
env: | |
GIT_REPOSITORY_TOKEN: ${{ secrets.GIT_REPLICATION_REPOSITORY_TOKEN }} | |
PROJECT_REPO: https://github.com/afzalex/afzalex.git | |
GIT_REPOSITORY_USERNAME: afzalex | |
REPLICATION_FILE_NAME: README.md | |
run: | | |
git clone ${PROJECT_REPO} replication | |
git -C ./replication config user.email afzalex.store@gmail.com | |
git -C ./replication config user.name "afzalex bot" | |
readmeMd5Orig=($(md5sum ${REPLICATION_FILE_NAME})) | |
readmeMd5Targ=($(md5sum ./replication/${REPLICATION_FILE_NAME})) | |
if [ ${readmeMd5Orig} != ${readmeMd5Targ} ]; then | |
echo Replicating ${REPLICATION_FILE_NAME} | |
mv ${REPLICATION_FILE_NAME} ./replication/${REPLICATION_FILE_NAME} | |
git -C ./replication add ${REPLICATION_FILE_NAME} | |
git -C ./replication commit -m "Updated README.md from afzalex/about" | |
cp ./auto-git.sh ./replication | |
cd ./replication | |
./auto-git.sh push | |
else | |
echo Already upto date... | |
fi | |