1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

workflow cache fixes

This commit is contained in:
Matthias Kretschmann 2019-11-19 23:27:17 +01:00
parent d680dd5545
commit 46e05e2501
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 13 additions and 13 deletions

View File

@ -22,8 +22,8 @@ jobs:
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}-
- name: Cache Gatsby build output
uses: actions/cache@v1

View File

@ -40,21 +40,25 @@ function normalizeData(workPlace, eduPlace, award) {
? eduPlace.studyType
: null
const { startDate, endDate, date } = workPlace || eduPlace || award
const startDate = award
? award.date
: (workPlace && workPlace.startDate) || (eduPlace && eduPlace.startDate)
return { title, subTitle, text, startDate, endDate, date }
const endDate = award
? null
: (workPlace && workPlace.endDate) || (eduPlace && eduPlace.endDate)
return { title, subTitle, text, startDate, endDate }
}
export default function ResumeItem({ workPlace, eduPlace, award }) {
const { title, subTitle, text, startDate, endDate, date } = normalizeData(
const { title, subTitle, text, startDate, endDate } = normalizeData(
workPlace,
eduPlace,
award
)
const dateStart = date
? new Date(date).getFullYear()
: new Date(startDate).getFullYear()
const dateStart = new Date(startDate).getFullYear()
const dateEnd = endDate && new Date(endDate).getFullYear()
const isSameYear = dateStart === dateEnd
@ -62,11 +66,7 @@ export default function ResumeItem({ workPlace, eduPlace, award }) {
<div className={styles.resumeItem}>
<span className={styles.time}>
{dateStart}
{dateEnd
? !isSameYear && `${dateEnd}`
: !date
? 'present'
: null}{' '}
{dateEnd ? !isSameYear && `${dateEnd}` : 'present'}{' '}
</span>
<h4 className={styles.title}>{title}</h4>
<h5 className={styles.subTitle}>{subTitle}</h5>