Fetch CPU Library #84
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: Fetch CPU Library | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 12 * * *' | |
jobs: | |
libfetch: | |
name: Fetch Library | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- name: Fetch CPU Library | |
run: | | |
python ./main.py | |
- name: Upload Rule File | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cpu_lib | |
path: ./cpu_lib.yaml | |
- name: Upload to server | |
env: | |
HOST: ${{ secrets.HOST }} | |
DESTINATION: ${{ secrets.DESTINATION }} | |
USER: ${{ secrets.USER }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
run: | | |
# echo "$PRIVATE_KEY" >> ./id_rsa_ls | |
# chmod 600 ./id_rsa_ls | |
# scp -P ${SSH_PORT} -i ./id_rsa_ls -o StrictHostKeyChecking=no ./cpu_lib.yaml ${USER}@${HOST}:${DESTINATION}/ | |
curl -T ./cpu_lib.yaml "${HOST}${DESTINATION}/cpu_lib.yaml" -u ${USER}:${PASSWORD} |