Skip to content

Ci cd workflow

Ci cd workflow #1

Workflow file for this run

name: SIT Server Mod CI/CD
on:
pull_request:
types:
- opened
- synchronize
- reopened
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.15.0'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Read package.json
id: read_package_json
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"
- name: Create artifact
uses: actions/upload-artifact@v2
with:
name: SITCoop
path: ./SITCoop
if: github.event_name == 'workflow_dispatch'
- name: Zip artifact
run: |
folder_name=$(find SITCoop* -maxdepth 0 -type d)
cd "$(dirname "${folder_name}")"
zip -r SITCoop.zip "$(basename "${folder_name}")" -x "*/\.*"
if: github.event_name == 'workflow_dispatch'
- name: Create release
uses: softprops/action-gh-release@v1
if: github.event_name == 'workflow_dispatch'
with:
tag_name: ${{ steps.read_package_json.outputs.version }}
name: SITCoop-${{ steps.read_package_json.outputs.version }}
files: SITCoop.zip
generate_release_notes: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}