mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
name: Deploying
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Install Yarn packages
|
|
run: yarn install
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Upload production-ready build files
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: production-files
|
|
path: ./dist
|
|
|
|
release:
|
|
name: Release
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: production-files
|
|
path: ./dist
|
|
|
|
- name: Zip files
|
|
run: cd dist && zip -r ../movie-web.zip .
|
|
|
|
- name: Get version
|
|
id: package-version
|
|
uses: martinbeentjes/npm-get-version-action@main
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.package-version.outputs.current-version }}
|
|
release_name: Movie web v${{ steps.package-version.outputs.current-version }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Upload Release Asset
|
|
id: 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: ./movie-web.zip
|
|
asset_name: movie-web.zip
|
|
asset_content_type: application/zip
|