-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (76 loc) · 2.74 KB
/
deploy.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
69
70
71
72
73
74
75
76
77
78
79
80
name: Deploy Aiku
on:
push:
branches: [ "production" ]
concurrency: production_deployment
permissions:
contents: write
jobs:
deployment:
name: Deploy aiku 🚀
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Composer install
run: php8.3 /usr/local/bin/composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: production
noVersionBumpBehavior: current
noNewCommitBehavior: current
majorList: MAJOR-RELEASE!
minorList: feature, features, feat, features, enhancement, enhancements
patchList: small, fix, bugfix, perf, refactor, test, tests, clean, cleanup, pint, partial, review, update-deps, chores, review, update, upgrade, change, changes, improve, improves, improvement, improvements,new, added, add, adds
patchAll: true
- name: Set .env
run: |
touch .env.aiku.production.deploy
echo RELEASE=${{ steps.semver.outputs.next }} >> .env.aiku.production.deploy
- name: Launch 🚀
uses: deployphp/action@v1
with:
dep: deploy aiku
ssh-config: ${{ secrets.DEPLOY_SSH_CONFIG }}
private-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
known-hosts: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
- name: Create Release
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ steps.semver.outputs.next }}
commit: 'production'
tag: ${{ steps.semver.outputs.next }}
token: ${{ github.token }}
- name: New Relic Application Deployment Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: aiku
version: ${{ steps.semver.outputs.next }}
user: "${{ github.actor }}"
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
with:
environment: production
projects: ${{ secrets.SENTRY_PROJECTS }}
version: ${{ steps.semver.outputs.next }}