-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 1.85 KB
/
satis.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
# @see https://github.com/ikselven/horde-satis.maintaina.com/blob/10030e3fbca81579dfd8ea2385d2291663b8bcbd/.github/workflows/horde-satis.yml
name: Satis Build
on:
workflow_call:
workflow_dispatch:
repository_dispatch:
push:
branches:
- master
env:
BUILD_DIR: build
concurrency:
group: build
cancel-in-progress: true
jobs:
builder:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create composer.json
run: echo "{}" > composer.json
- name: Get Date
id: get-date
run: echo "date=$(/bin/date -u "+%F")" >> $GITHUB_OUTPUT
- name: Cache dependencies and build
uses: actions/cache@v4
with:
path: |
~/.composer
${{ env.BUILD_DIR }}
key: ${{ runner.os }}-php-${{ steps.get-date.outputs.date }}
restore-keys: ${{ runner.os }}-php-
- name: Docker pull
run: docker pull composer/satis
- name: Docker build
run: |
export COMPOSER_HOME="$HOME/.composer"
composer config -g github-oauth.github.com "${{ secrets.GENEROI_DEPLOY_PAT }}"
docker run --rm --init \
--user $(id -u):$(id -g) \
--volume $(pwd):/build \
--volume "${COMPOSER_HOME}:/composer" \
composer/satis -vvv build /build/satis.json /build/${{ env.BUILD_DIR }} --no-interaction
- name: Publish to GitHub pages
run: |
rm composer.json
git checkout gh-pages
rm -rf include/*
cp -R ${{ env.BUILD_DIR }}/* .
rm -rf ${{ env.BUILD_DIR }}/
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Updated repository"
git push