Skip to content

Commit

Permalink
Updated github action to skip if secrets missing
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen committed Jul 28, 2024
1 parent c62149e commit 2c2f39c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@ jobs:
shell: bash
run: |
if [ "${{ secrets.GITHUB_TOKEN }}" != '' ]; then
echo "ok=enabled" >> $GITHUB_OUTPUT
echo "available=false" >> $GITHUB_OUTPUT;
else
echo "available=true" >> $GITHUB_OUTPUT;
fi
- name: Download artifact
uses: actions/download-artifact@v3
if: ${{ steps.secret-check.outputs.available == 'true' }}
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ steps.secret-check.outputs.available == 'true' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit 2c2f39c

Please sign in to comment.