-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (72 loc) · 2.46 KB
/
unstable.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
81
82
83
84
85
name: 'unstable'
on:
push:
branches: [ 'main' ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "8.1"
steps:
- uses: actions/checkout@v4
id: code-checkout
- name: Setup PHP
uses: ./.github/actions/setup-php
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Lint
uses: ./.github/actions/lint
- name: Test w/Coverage
uses: ./.github/actions/test-coverage
env:
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
package:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "8.1"
permissions:
id-token: write
contents: write
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
needs: [ lint ]
steps:
- uses: actions/checkout@v4
id: code-checkout
- name: Setup PHP
uses: ./.github/actions/setup-php
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Build package
id: build-package
run: |
cd src
export ARTIFACT_FILE=yap-${GITHUB_RUN_NUMBER}-${GITHUB_SHA}
export ARTIFACT_FILENAME=${ARTIFACT_FILE}.zip
echo "ARTIFACT_FILENAME=${ARTIFACT_FILENAME}" >> $GITHUB_ENV
git archive --format=zip --output=${ARTIFACT_FILENAME} --prefix=${ARTIFACT_FILE}/ HEAD
DISABLE_NOTIFIER=true make deploy
unzip ${ARTIFACT_FILENAME}
rm ${ARTIFACT_FILENAME}
echo ${GITHUB_SHA} > ${ARTIFACT_FILE}/storage/app/build.txt
cp -R vendor ${ARTIFACT_FILE}/
mkdir -p ${ARTIFACT_FILE}/public/dist && cp -R public/dist/. ${ARTIFACT_FILE}/public/dist
find ./${ARTIFACT_FILE} -type d | xargs chmod 755
find ./${ARTIFACT_FILE} -name '*.php' | xargs chmod 644
zip -r -9 ${ARTIFACT_FILENAME} ${ARTIFACT_FILE}
mkdir artifacts/
mv ${ARTIFACT_FILENAME} artifacts/
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-s3-artifact
role-session-name: gh-actions-jft
aws-region: us-east-1
- name: copy artifact to s3
run: |
aws s3 cp src/artifacts/${ARTIFACT_FILENAME} s3://${{ secrets.S3_BUCKET }}/yap/${ARTIFACT_FILENAME}