Skip to content

Commit

Permalink
split deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
drmowinckels committed Jul 17, 2023
1 parent 90a1d4e commit f092204
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ jobs:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-22.04
steps:
- name: Get environment
run: |
echo "issue=${{ github.event.inputs.orig_pr || github.event.pull_request.number }}" >> $GITHUB_ENV
repo_name=${{ github.event.inputs.orig_pr && 'rladies/directory' || github.repository }}
echo "repo_name=$(basename ${repo_name})" >> $GITHUB_ENV
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "token=${{ secrets.GITHUB_PAT }}" >> $GITHUB_ENV
echo "netalias=${{ github.event.inputs.directory }}" >> $GITHUB_ENV
else
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "netalias=${{ github.event.number }}" >> $GITHUB_ENV
fi
- name: Install netlify cli
if: github.ref != 'refs/heads/main'
Expand All @@ -182,16 +194,6 @@ jobs:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
echo "issue=${{ github.event.inputs.orig_pr || github.event.pull_request.number }}" >> $GITHUB_ENV
repo_name=${{ github.event.inputs.orig_pr && 'rladies/directory' || github.repository }}
echo "repo_name=$(basename ${repo_name})" >> $GITHUB_ENV
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "token=${{ secrets.GITHUB_PAT }}" >> $GITHUB_ENV
echo "netalias=${{ github.event.inputs.directory }}" >> $GITHUB_ENV
else
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "netalias=${{ github.event.number }}" >> $GITHUB_ENV
fi
netlify deploy \
--alias ${{ env.netalias }} \
--dir=public
Expand Down

0 comments on commit f092204

Please sign in to comment.