Skip to content

ghacts/manual-deploy-to-netlify

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Manual deploy to Netlify Action

Test

Description

GitHub Actions for manual deploying static site to Netlify.

Inputs

parameter description required default
auth-token Netlify authentication token true
site Netlify site name true
dir Directory to deploy false dist/
filter For monorepos, specify the name of the application to run the command in false
functions Netlify functions directory to deploy false
message Deploy message false
alias Site alias false
prod Deploy to production false false

Outputs

parameter description
success Deployment success
netlify-deploy-url Netlify deploy URL

Examples

jobs:
  deploy-preview:
    name: Deploy preview site
    runs-on: ubuntu-latest
    environment:
      name: preview
      url: ${{ steps.deploy_preview.outputs.netlify-deploy-url }}
    steps:
      - name: Checkout
        id: checkout
        uses: actions/checkout@v4

      - name: Deploy preview site
        id: deploy_preview
        uses: ./
        with:
          auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          site: ${{ vars.NETLIFY_SITE_NAME }}
          dir: sites/preview
          alias: preview
jobs:
  deploy-production:
    name: Deploy production site
    runs-on: ubuntu-latest
    if: always()
    environment:
      name: production
      url: ${{ steps.deploy_production.outputs.netlify-deploy-url }}
    steps:
      - name: Checkout
        id: checkout
        uses: actions/checkout@v4

      - name: Deploy production site
        id: deploy_production
        uses: ./
        with:
          auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          site: ${{ vars.NETLIFY_SITE_NAME }}
          dir: sites/production
          prod: true

Contact

Le Minh Tri @ansidev.

License

This source code is available under the MIT LICENSE.

About

GitHub Actions for manual deploying static site projects to Netlify

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages