-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-to-php-8.0
- Loading branch information
Showing
11 changed files
with
150 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
COMPOSER_DEV_ARG= | ||
IMAGE_TAG=develop | ||
DATA_FOLDER= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: CI Pipeline | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
generate-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
trunkver: ${{ steps.trunkver.outputs.trunkver }} | ||
steps: | ||
- name: Get a version tag | ||
id: trunkver | ||
uses: crftd-tech/trunkver@main | ||
with: | ||
prerelease: ${{ github.ref == 'refs/heads/master' && 'false' || 'true' }} | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Bring up test stack | ||
run: docker compose up --wait | ||
- name: Debug bring up test stack | ||
if: failure() | ||
run: docker compose logs | ||
- name: Project Tests | ||
run: docker compose exec app bash ./project_tests.sh | ||
- name: Smoke Tests | ||
run: docker compose exec app bash ./smoke_tests.sh | ||
build-and-push: | ||
needs: [generate-version, tests] | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
IMAGE_REPO: ghcr.io/elifesciences/api-dummy | ||
IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && needs.generate-version.outputs.trunkver || format('{0}-{1}', github.head_ref || github.ref_name, needs.generate-version.outputs.trunkver) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push client image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
load: false | ||
# Disabled until elifesciences/php or another image with ARM support can be used as a base | ||
# platforms: linux/amd64,linux/arm64 | ||
target: prod | ||
tags: | | ||
${{ env.IMAGE_REPO }}:${{ github.sha }} | ||
${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
services: | ||
composer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: build | ||
volumes: | ||
- ./composer.json:/app/composer.json | ||
- ./composer.lock:/app/composer.lock | ||
- ./vendor:/app/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
version: '3' | ||
|
||
services: | ||
composer: | ||
volumes: | ||
- ./composer.json:/app/composer.json | ||
- ./composer.lock:/app/composer.lock | ||
- vendor:/app/vendor | ||
cli: | ||
volumes: | ||
- ./:/srv/api-dummy | ||
- /srv/api-dummy/build | ||
- vendor:/srv/api-dummy/vendor | ||
|
||
volumes: | ||
vendor: | ||
app: | ||
depends_on: | ||
composer: | ||
condition: service_completed_successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
version: '3' | ||
|
||
version: "2.4" | ||
services: | ||
composer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.composer | ||
args: | ||
composer_dev_arg: ${COMPOSER_DEV_ARG} | ||
image: elifesciences/api-dummy_composer:${IMAGE_TAG} | ||
command: /bin/bash | ||
cli: | ||
dockerfile: Dockerfile | ||
target: build | ||
command: install | ||
volumes: | ||
- ./composer.json:/app/composer.json | ||
- ./composer.lock:/app/composer.lock | ||
- vendor:/app/vendor | ||
|
||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
image_tag: ${IMAGE_TAG} | ||
target: dev | ||
image: elifesciences/api-dummy:${IMAGE_TAG:-dev} | ||
environment: | ||
DATA_FOLDER: ${DATA_FOLDER} | ||
image: elifesciences/api-dummy:${IMAGE_TAG} | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- composer | ||
volumes: | ||
- ./:/srv/api-dummy | ||
- /srv/api-dummy/build | ||
- vendor:/srv/api-dummy/vendor | ||
|
||
volumes: | ||
vendor: |