-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (62 loc) · 2.16 KB
/
Copy pathdev.yml
File metadata and controls
70 lines (62 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Debug Post
on:
push:
branches:
- '**'
- '!master'
workflow_dispatch:
permissions:
actions: read
jobs:
run-cute-pets:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
cache: 'pip'
- name: Install dependencies
run: pip install --break-system-packages -r requirements.txt
- name: Get Previous Run ID
continue-on-error: true
id: get_id
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetches the ID of the last completed run for the current workflow
PREVIOUS_RUN_ID=$(gh run list \
--branch "${{ github.ref_name }}" \
--workflow "${{ github.workflow }}" \
--status success \
--limit 1 \
--json databaseId \
--jq '.[0].databaseId')
echo "previous_run_id=$PREVIOUS_RUN_ID" >> "$GITHUB_OUTPUT"
- name: Download previous database artifact
uses: actions/download-artifact@v8
with:
name: database.json
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ steps.get_id.outputs.previous_run_id }}
continue-on-error: true
- name: Call RescueGroups API
env:
CUTEPETSBOSTON_RESCUEGROUPS_API_KEY: ${{ secrets.CUTEPETSBOSTON_RESCUEGROUPS_API_KEY }}
INSTAGRAM_BUSINESS_ACCOUNT_ID: ${{ secrets.INSTAGRAM_BUSINESS_ACCOUNT_ID }}
INSTAGRAM_PAGE_ACCESS_TOKEN: ${{ secrets.INSTAGRAM_PAGE_ACCESS_TOKEN }}
BLUESKY_HANDLE: ${{ secrets.BLUESKY_TEST_HANDLE }}
BLUESKY_PASSWORD: ${{ secrets.BLUESKY_TEST_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
APP_ENV: dev
run: |
#In order to create posts on the test accounts remove the --debugposters debug flag
python ./main.py --debugsources --debugposters
- name: Upload database artifact
uses: actions/upload-artifact@v7
with:
path: database.json
retention-days: 1
archive: false