Skip to content

Commit 182fe1c

Browse files
committed
Add date to build and build a full deck only on master
1 parent fccbde6 commit 182fe1c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/build-deck.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ jobs:
1313
python-version: 3.9
1414
- name: Install requirements
1515
run: pip install -r requirements.txt
16+
- name: Get current date
17+
id: date
18+
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H:%M:%S')"
19+
- name: Get current timestamp
20+
id: timestamp
21+
run: echo "::set-output name=timestamp::$(date +'%s')"
1622
- name: Test build Anki Deck
1723
run: python generate.py --stop 3
1824
env:
1925
LEETCODE_CSRF_TOKEN: ${{ secrets.LEETCODE_CSRF_TOKEN }}
2026
LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }}
2127
- name: Build Anki Deck
2228
run: python generate.py
29+
if: github.ref == 'refs/heads/master'
2330
env:
2431
LEETCODE_CSRF_TOKEN: ${{ secrets.LEETCODE_CSRF_TOKEN }}
2532
LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }}
@@ -29,8 +36,9 @@ jobs:
2936
env:
3037
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3138
with:
32-
tag_name: ${{ github.ref }}
33-
release_name: Release ${{ github.ref }}
39+
tag_name: ${{ github.ref }}-${{ steps.timestamp.outputs.timestamp }}
40+
release_name: >
41+
Anki Deck from ${{ github.ref }} on ${{ steps.date.outputs.date }}
3442
draft: true
3543
prerelease: true
3644
- name: Upload release asset

0 commit comments

Comments
 (0)