-
Notifications
You must be signed in to change notification settings - Fork 14
68 lines (58 loc) · 1.86 KB
/
package.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
defaults:
run:
working-directory: build
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build-and-package:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: build
- name: Branch Name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Build
uses: php-actions/composer@v6
with:
php_version: "8.0"
dev: no
args: --optimize-autoloader
working_dir: build
- name: Package
run: |
sudo cp .env.dist .env
sudo rm -rf var/cache/*
tar -czf strichliste-backend.tar.gz .env *
- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
tag_name: ${{ steps.branch_name.outputs.SOURCE_TAG }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/strichliste-backend.tar.gz
asset_name: strichliste-backend-${{ steps.branch_name.outputs.SOURCE_TAG }}.tar.gz
asset_content_type: application/gzip