Skip to content

ci

ci #1796

Workflow file for this run

name: ci
on:
workflow_dispatch:
schedule:
- cron: "0 */2 * * *"
jobs:
CreateImage:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [18]
steps:
- name: actions-timeline
uses: Kesin11/actions-timeline@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: ^7.0
- name: Install Deps
run: pnpm install --no-frozen-lockfile
- name: Build
run: pnpm run build
- name: Create Image
run: pnpm run start --cookie "${{ secrets.BING_COOKIE }}"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Backup Images to s3
env:
ENDPOINT_URL: ${{ secrets.ENDPOINT_URL }}
IMG_ACCESS_URL: ${{ secrets.IMG_ACCESS_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
run: python3 main.py
- name: Push New Pic
run: |
git config --local user.email "[email protected]"
git config --local user.name "${{ github.actor }}"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add .
git commit -m "generated pic" || echo "no need to commit "
git pull origin main --rebase
git push -f || echo "no file change"