movie-web/.github/workflows/deploying.yml

78 lines
1.7 KiB
YAML
Raw Normal View History

2022-05-02 15:59:11 +02:00
name: Deploying
2021-07-14 00:31:37 +02:00
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
2023-01-19 04:55:03 +01:00
uses: actions/checkout@v3
2021-07-14 00:31:37 +02:00
- name: Install Node.js
2023-01-19 04:55:03 +01:00
uses: actions/setup-node@v3
2021-07-14 00:31:37 +02:00
with:
2023-01-19 04:55:03 +01:00
node-version: 18
2023-03-10 19:35:51 +01:00
cache: 'yarn'
2021-07-14 00:31:37 +02:00
2021-07-14 00:33:02 +02:00
- name: Install Yarn packages
run: yarn install
2021-07-14 00:31:37 +02:00
- name: Build project
2023-03-10 19:35:51 +01:00
run: yarn build
2021-07-14 00:31:37 +02:00
- name: Upload production-ready build files
2023-01-19 04:55:03 +01:00
uses: actions/upload-artifact@v3
2021-07-14 00:31:37 +02:00
with:
name: production-files
2022-12-18 19:19:24 +01:00
path: ./dist
2022-05-02 15:59:11 +02:00
2022-12-27 14:40:43 +01:00
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
2022-12-27 14:45:26 +01:00
- name: Checkout code
2023-01-19 04:55:03 +01:00
uses: actions/checkout@v3
2022-12-27 14:45:26 +01:00
2022-12-27 14:40:43 +01:00
- name: Download artifact
2023-01-19 04:55:03 +01:00
uses: actions/download-artifact@v3
2022-12-27 14:40:43 +01:00
with:
name: production-files
path: ./dist
- name: Zip files
2022-12-27 14:58:54 +01:00
run: cd dist && zip -r ../movie-web.zip .
2022-12-27 14:40:43 +01:00
- 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
2022-12-27 14:41:47 +01:00
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
2022-12-27 14:52:27 +01:00
asset_name: movie-web.zip
2022-12-27 14:41:47 +01:00
asset_content_type: application/zip