Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ignore-build #771

Closed
wants to merge 15 commits into from
46 changes: 46 additions & 0 deletions .github/workflows/netlify-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy to Netlify

on:
pull_request:
types: [ labeled, opened, synchronize, reopened ]

jobs:
build:
runs-on: ubuntu-latest
if: contains( github.event.pull_request.labels.*.name, 'deploy-me')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- name: Setup
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
env:
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './public'
production-branch: main
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
deploy-message: '#${{ github.event.number }} ${{ github.event.pull_request.title }}: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
enable-github-deployment: false
alias: deploy-preview-${{ github.event.number }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
Loading