Skip to content

Commit

Permalink
add github action workflows (#1)
Browse files Browse the repository at this point in the history
* Create dev_alias.yml

* Update dev_alias.yml (netlify cli)

* Update dev_alias.yml (fix vars)

* Update dev_alias.yml (environment)

* Create tag_release.yml
  • Loading branch information
JimmyZJX committed Dec 27, 2023
1 parent 8ddec61 commit 1bd6e6e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/dev_alias.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy all commits to netlify alias site

on:
push

jobs:
build:

runs-on: ubuntu-latest
environment: netlify dsp-calc.pro

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- run: npm install
- run: npm run build

- run: npm install netlify-cli -g

- name: Deploy to netlify (alias)
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }}
run: netlify deploy --dir dist --prod-if-unlocked --alias ${{ github.ref_name }}
29 changes: 29 additions & 0 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy on tag to the main site

on:
push:
tags:
- '*'

jobs:
build:

runs-on: ubuntu-latest
environment: netlify dsp-calc.pro

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- run: npm install
- run: npm run build

- run: npm install netlify-cli -g

- name: Deploy to netlify (main site)
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ vars.NETLIFY_SITE_ID }}
run: netlify deploy --dir dist --prod-if-unlocked

0 comments on commit 1bd6e6e

Please sign in to comment.