Skip to content

Commit

Permalink
Merge pull request #2 from azachwill/devcommit2
Browse files Browse the repository at this point in the history
devcommit2
  • Loading branch information
awilliams1275 authored Aug 12, 2024
2 parents 83f41e9 + c4d29f3 commit 97d2156
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and deploy website

on:
push:
branches: [main]
branches: [master, main]
pull_request:
branches: [main]
branches: [master, main]

jobs:
build:
Expand Down Expand Up @@ -70,12 +70,10 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
run: |
set -x
echo "RELEASE_NAME=pr-${PR_NUMBER}" >> $GITHUB_ENV
- name: Configure branch release name
if: ${{github.event_name != 'pull_request'}}
run: |
set -x
# use branch name, but replace slashes. E.g. feat/a -> feat-a
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
- name: Create Github "view deployment" button in PR
Expand All @@ -96,13 +94,9 @@ jobs:
REF_NAME: ${{ github.ref_name }}
ALIAS: ${{ steps.deployment.outputs.env }}
run: |
echo "${ALIAS}"
echo ${{ steps.deployment.outputs.env }}
echo "${REF_NAME}"
set -x
npm install -g netlify-cli
# push main branch to production, others to preview --
if [ "${REF_NAME}" = "main" ]; then
if [ "${REF_NAME}" = "master" ] || [ "${REF_NAME}" = "main" ]; then
netlify deploy --dir=_build/ --prod
else
netlify deploy --dir=_build/ --alias="${ALIAS}"
Expand All @@ -117,6 +111,4 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env: ${{ steps.deployment.outputs.env }}
env_url: "https://${{ steps.deployment.outputs.env }}--shyr-test-center.netlify.app"
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"


logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 comments on commit 97d2156

Please sign in to comment.