-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (47 loc) · 1.53 KB
/
Copy pathbuild.yml
File metadata and controls
55 lines (47 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build
on:
push:
branches: ["master"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Clean Install Dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Copy files to dist
run: |
cp package-lock.json dist/
cp package.json dist/
cp README.md dist/
cp LICENSE dist/
cp .env.example dist/
cp .dockerignore dist/
cp .gitignore dist/
cp Dockerfile dist/
cp ecosystem.config.js dist/
echo "Build Date: $(date)" >> dist/build-info.txt
- name: Get latest commit hash
run: |
echo "MASTER_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "COMMIT_URL=https://github.com/${{ github.repository }}/commit/$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Upload
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: dist/
destination-github-username: 'mrepol742'
destination-repository-name: 'project-canis'
user-name: github-actions[bot]
user-email: github-actions[bot]@users.noreply.github.com
commit-message: "Build from ${{ env.COMMIT_URL }}"
target-branch: build