Skip to content

Commit

Permalink
deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Dec 8, 2023
1 parent 34aa404 commit deab99f
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Release

on:
push:
tags:
- '*'

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Increment package.json version
run: npm version patch

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

- name: Extract tag name
id: get_tag
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})"
env:
GITHUB_REF: ${{ github.ref }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
release_name: Release ${{ steps.get_tag.outputs.tag }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist
asset_name: dist.zip
asset_content_type: application/zip

0 comments on commit deab99f

Please sign in to comment.