Skip to content

Commit 88dea5b

Browse files
committed
Added image publishing to the ghcr for every release, chnaged the default config's app path.
1 parent 90d1ce6 commit 88dea5b

2 files changed

Lines changed: 72 additions & 1 deletion

File tree

.github/workflows/releases.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
pull_request:
88
branches: [ 'master' ]
99

10+
permissions:
11+
contents: write
12+
packages: write
13+
1014
jobs:
1115
build:
1216
runs-on: ubuntu-latest
@@ -106,3 +110,70 @@ jobs:
106110
../${{ steps.repository.outputs.pathref }}.tar.gz
107111
fail_on_unmatched_files: true
108112
if: startsWith(github.ref, 'refs/tags/')
113+
114+
- name: Set image names
115+
id: image_names
116+
if: startsWith(github.ref, 'refs/tags/')
117+
run: |
118+
owner=$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')
119+
repo=$(echo "${GITHUB_REPOSITORY#*/}" | tr '[:upper:]' '[:lower:]')
120+
echo "app=ghcr.io/${owner}/${repo}" >> "$GITHUB_OUTPUT"
121+
echo "stats=ghcr.io/${owner}/${repo}-stats" >> "$GITHUB_OUTPUT"
122+
123+
- name: Set up Docker Buildx
124+
if: startsWith(github.ref, 'refs/tags/')
125+
uses: docker/setup-buildx-action@v3
126+
127+
- name: Log in to GHCR
128+
if: startsWith(github.ref, 'refs/tags/')
129+
uses: docker/login-action@v3
130+
with:
131+
registry: ghcr.io
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
134+
135+
- name: Docker metadata (app)
136+
id: meta_app
137+
if: startsWith(github.ref, 'refs/tags/')
138+
uses: docker/metadata-action@v5
139+
with:
140+
images: ${{ steps.image_names.outputs.app }}
141+
tags: |
142+
type=raw,value=${{ github.ref_name }}
143+
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
144+
labels: |
145+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
146+
org.opencontainers.image.revision=${{ github.sha }}
147+
148+
- name: Build and push app image
149+
if: startsWith(github.ref, 'refs/tags/')
150+
uses: docker/build-push-action@v6
151+
with:
152+
context: .
153+
file: ./Dockerfile
154+
push: true
155+
tags: ${{ steps.meta_app.outputs.tags }}
156+
labels: ${{ steps.meta_app.outputs.labels }}
157+
158+
- name: Docker metadata (stats)
159+
id: meta_stats
160+
if: startsWith(github.ref, 'refs/tags/')
161+
uses: docker/metadata-action@v5
162+
with:
163+
images: ${{ steps.image_names.outputs.stats }}
164+
tags: |
165+
type=raw,value=${{ github.ref_name }}
166+
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
167+
labels: |
168+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
169+
org.opencontainers.image.revision=${{ github.sha }}
170+
171+
- name: Build and push stats image
172+
if: startsWith(github.ref, 'refs/tags/')
173+
uses: docker/build-push-action@v6
174+
with:
175+
context: .
176+
file: ./Dockerfile.stats
177+
push: true
178+
tags: ${{ steps.meta_stats.outputs.tags }}
179+
labels: ${{ steps.meta_stats.outputs.labels }}

config/autoload/local.php.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* credentials from accidentally being committed into version control.
1212
*/
1313

14-
$appdir = getenv('APP_DIR') ?: '/var/lib/monarc';
14+
$appdir = getenv('APP_DIR') ?: '/var/lib/monarc/fo';
1515

1616
$package_json = json_decode(file_get_contents('./package.json'), true);
1717

0 commit comments

Comments
 (0)