From 3106681e7c461f90cb198b5b3d796fe43e0b91b3 Mon Sep 17 00:00:00 2001 From: wilderPariona Date: Sun, 12 Jul 2020 01:04:26 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20FEATURE:=20Add=20configuration?= =?UTF-8?q?=20Github=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/development.yml | 32 +++++++++++++++++++++++++++++++ .github/workflows/production.yml | 32 +++++++++++++++++++++++++++++++ .github/workflows/staging.yml | 32 +++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .github/workflows/development.yml create mode 100644 .github/workflows/production.yml create mode 100644 .github/workflows/staging.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..ace97a9 --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,32 @@ +name: Development workflow + +on: + push: + branches: + - dev + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: 📦 Checkout code + - uses: actions/checkout@v1 + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: 🏗 Install and Build + run: | + npm install + npm run build --if-present + + - name: 🚀 Deploy to netlify + uses: netlify/actions/cli@master + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.DEV_NETLIFY_SITE_ID }} + with: + args: deploy --dir=build --prod + secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]' diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 0000000..825cf68 --- /dev/null +++ b/.github/workflows/production.yml @@ -0,0 +1,32 @@ +name: Production workflow + +on: + push: + tags: + - "v*" + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: 📦 Checkout code + - uses: actions/checkout@v1 + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: 🏗 Install and Build + run: | + npm install + npm run build --if-present + + - name: 🚀 Deploy to netlify + uses: netlify/actions/cli@master + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.PROD_NETLIFY_SITE_ID }} + with: + args: deploy --dir=build --prod + secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]' diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 0000000..0307792 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,32 @@ +name: Staging workflow + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: 📦 Checkout code + - uses: actions/checkout@v1 + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: 🏗 Install and Build + run: | + npm install + npm run build --if-present + + - name: 🚀 Deploy to netlify + uses: netlify/actions/cli@master + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.STAGING_NETLIFY_SITE_ID }} + with: + args: deploy --dir=build --prod + secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]'