Skip to content

Commit

Permalink
ci: updated branch PR logic
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Sep 20, 2023
1 parent 65ecd70 commit cca2169
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
71 changes: 38 additions & 33 deletions .github/workflows/version-branch-update.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Version Branch Update

on:
pull_request:
pull_request_target:
branches:
- 'version-[0-9]-[0-9]'
types: [opened, synchronize, reopened]
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4



Expand All @@ -50,36 +50,41 @@ jobs:

- run: npm ci

- name: Post Netlify progress
uses: mshick/add-pr-comment@v2
with:
message: |
πŸ€– Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes.
refresh-message-position: true
update-only: true

- name: Netlify Build
- name: compile
run: |
make versions-ci
netlify build --context deploy-preview
- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v2.1.0
with:
publish-dir: ./build
deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}'
enable-pull-request-comment: true
overwrites-pull-request-comment: true
enable-commit-comment: true

- name: Post Netlify URL
uses: mshick/add-pr-comment@v2
with:
message: |
πŸš€ Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes.
message-failure: |
πŸ‘Ž Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information.
refresh-message-position: true
update-only: true
make build
# - name: Post Netlify progress
# uses: mshick/add-pr-comment@v2
# with:
# message: |
# πŸ€– Starting the Netlify preview build for commit ${{ github.sha }}. This may take a few minutes.
# refresh-message-position: true
# update-only: true

# - name: Netlify Build
# run: |
# make versions-ci
# netlify build --context deploy-preview


# - name: Deploy to Netlify
# id: netlify
# uses: nwtgck/actions-netlify@v2.1.0
# with:
# publish-dir: ./build
# deploy-message: 'Manual Netlify deployment from GitHub Actions - ${{ github.sha }}'
# enable-pull-request-comment: true
# overwrites-pull-request-comment: true
# enable-commit-comment: true

# - name: Post Netlify URL
# uses: mshick/add-pr-comment@v2
# with:
# message: |
# πŸš€ Netlify preview deployed succesfully for commit ${{ github.sha }}. Click [here](${{steps.netlify.outputs.deploy-url}}) to preview the changes.
# message-failure: |
# πŸ‘Ž Uh oh! The Netlify Preview failed to deploy for commit ${{ github.sha }}. Please check the Netlify logs for more information.
# refresh-message-position: true
# update-only: true
2 changes: 1 addition & 1 deletion scripts/netlify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# List of branches to NOT create an automatic Netlify preview
disallowed_branches=("master" "release-*" "version-*")
disallowed_branches=("master" "release-*")

# Get current branch name
current_branch=$(git branch --show-current)
Expand Down

0 comments on commit cca2169

Please sign in to comment.