Skip to content

jobs update

jobs update #2719

Workflow file for this run

name: jobs update
on:
workflow_dispatch:
schedule:
- cron: 0 2 * * *
- cron: 5 15 * * *
- cron: 5 10 * * *
- cron: 5 20 * * *
jobs:
update-jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Remove Expired Jobs
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-pip python3-setuptools wget
sudo pip3 install -r scripts/requirements.txt
python3 scripts/update_jobs.py
- name: Job Updater
uses: rseng/jobs-updater@main
with:
filename: "_data/jobs.yaml"
previous_filename: "_data/previous-jobs.yaml"
# Fields to include (all but url will have title before)
keys: "title,location,employer,remote,url"
# Field to determine job uniqueness
unique: "url"
deploy: true
test: false
twitter_deploy: false
hashtag: "#HPC"
slack_deploy: true
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
discord_deploy: true
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
mastodon_deploy: true
mastodon_access_token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
mastodon_api_base_url: ${{ secrets.MASTODON_API_BASE_URL }}
- run: echo ${{ steps.updater.outputs.fields }}
name: Show Fields Used
shell: bash
- run: echo ${{ steps.updater.outputs.matrix }}
name: Show New Jobs
shell: bash
- name: Push Fixes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git add _data/jobs.yaml
set +e
git status | grep modified
if [ $? -eq 0 ]; then
set -e
printf "Changes\n"
git commit -m "Automated push to update jobs $(date '+%Y-%m-%d')" || exit 0
git push origin main
else
set -e
printf "No changes\n"
fi