-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (38 loc) · 1.49 KB
/
sync.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
name: Synchronize
on:
workflow_dispatch:
release:
types: [published]
jobs:
sync:
name: Synchronize
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
stack: ['heroku-20', 'heroku-22']
env:
S3_BUCKET: heroku-php-extensions
BUILDPACK: ./vendor/heroku/heroku-buildpack-php
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Composer Install
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
- name: Copy requirements
run: cp ${BUILDPACK}/requirements.txt .
- name: Build Dockerfile
run: |
cat ${BUILDPACK}/support/build/_docker/${{ matrix.stack }}.Dockerfile > docker/build/${{ matrix.stack }}.Dockerfile
cat docker/${{ matrix.stack }}.Dockerfile >> docker/build/${{ matrix.stack }}.Dockerfile
- name: Docker build
run: docker build --pull --tag ${{ matrix.stack }} --file docker/build/${{ matrix.stack }}.Dockerfile .
- name: Synchronize stable repository
shell: 'script -q -e -c "bash {0}"'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
echo "yes" | docker run --rm -i \
--env-file=${BUILDPACK}/support/build/_docker/env.default \
${{ matrix.stack }} sync.sh $S3_BUCKET dist-${{ matrix.stack }}-stable/ $S3_BUCKET dist-${{ matrix.stack }}-develop/