make condition for gen step more explicit #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Preview Theme Changes | |
on: | |
push: | |
branches: | |
- add/playground-theme-preview | |
jobs: | |
prepare-and-upload-zips: | |
runs-on: ubuntu-latest | |
outputs: | |
zip_paths: ${{ steps.prepare_zips.outputs.zip_paths }} | |
artifacts_created: ${{ steps.prepare_zips.outputs.zip_paths != '' }} | |
has_artifacts: ${{ steps.prepare_zips.outputs.zip_paths != '' && 'true' || 'false' }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Prepare Zips and Determine Paths | |
id: prepare_zips | |
run: bash bin/prepare-zips.sh | |
- name: Upload Zips as Artifacts | |
if: steps.prepare_zips.outputs.zip_paths != '' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: theme-zips | |
path: ${{ steps.prepare_zips.outputs.zip_paths }} | |
generate-and-post-preview-links: | |
needs: prepare-and-upload-zips | |
if: needs.prepare-and-upload-zips.outputs.has_artifacts == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: theme-zips | |
- name: Generate Preview Links | |
id: generate_links | |
run: bash bin/generate-preview-links.sh "${{ github.event.pull_request.number }}" "${{ needs.prepare-and-upload-zips.outputs.zip_paths }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |