Skip to content

Commit

Permalink
generate a date in a pre-step
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaubrey committed Nov 8, 2024
1 parent 3cfc44d commit 624bf84
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/previews.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ on:
types: [labeled, unlabeled, synchronize, opened, reopened]

jobs:
generate-date:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.date.outputs.date }}
steps:
- name: Get current date
id: date
run: echo "date=$(date --utc +%Y%m%d.%H%M)" >> $GITHUB_OUTPUT
build-preview-image:
runs-on: ubuntu-latest
needs: [generate-date]
if: ${{ contains(github.event.pull_request.labels.*.name, 'preview-prod-gateway') || contains(github.event.pull_request.labels.*.name, 'preview-api-dummy') }}
env:
CONTAINER_REPO: ghcr.io/elifesciences/journal
CONTAINER_TAG: preview-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-${{ steps.date.outputs.date }}
CONTAINER_TAG: preview-${{ github.event.number }}-${{ github.event.pull_request.head.sha }}-${{ needs.generate-date.outputs.date }}
steps:
- uses: actions/checkout@v4
- name: Login to GHCR
Expand Down

0 comments on commit 624bf84

Please sign in to comment.