-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use devcontainer and ci from portals
- Loading branch information
1 parent
24cb9f2
commit 69b7ccb
Showing
12 changed files
with
691 additions
and
162 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
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,70 @@ | ||
name: Docker e2e Test | ||
|
||
on: | ||
pull_request: {} | ||
|
||
env: | ||
IMAGE_REGISTRY: ghcr.io | ||
IMAGE_PATH: ${{ github.repository }} | ||
IMAGE_TAG: ${{ github.ref_name }} | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Build Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
load: true | ||
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest | ||
- name: Create Environment | ||
run: | | ||
cat > .env << EOF | ||
APP_NAME="Erstiwoche FB5" | ||
APP_ENV=local | ||
APP_KEY=1234567890ABCDEFGHIJ1234567890AB | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
APP_FORCE_HTTPS=false | ||
APP_EVENT_TYPE=demo | ||
TUTOR_PASSWORD=password | ||
ADMIN_PASSWORD=admin | ||
LOG_CHANNEL=stack | ||
LOG_LEVEL=debug | ||
BROADCAST_CONNECTION=log | ||
CACHE_STORE=file # TODO | ||
FILESYSTEM_DRIVER=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file # TODO | ||
SESSION_LIFETIME=120 | ||
MEMCACHED_HOST=127.0.0.1 | ||
OCTANE_HTTPS=false | ||
OCTANE_WORKERS=1 | ||
OCTANE_MAX_REQUESTS=512 | ||
WWWGROUP=1000 | ||
WWWUSER=1000 | ||
OCTANE_SERVER=roadrunner | ||
EOF | ||
- name: Run Image | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: "docker-compose.yaml" | ||
down-flags: "--volumes" | ||
- name: Wait | ||
run: | | ||
# wait 10 seconds for the docker container to start | ||
sleep 10 | ||
- name: Run DB Seed | ||
run: | | ||
# run "php artisan migrate:fresh --seed" inside docker container | ||
docker exec portals-web php artisan migrate:fresh --seed | ||
- name: Debug | ||
run: | | ||
curl http://localhost:8000 | ||
- name: Test reachable | ||
run: | | ||
# test every 10 seconds if http://localhost:8000 is reachable and has a OK status code. Timeout after 2 minutes | ||
timeout 120 bash -c 'until curl --output /dev/null --silent --head --fail http://localhost:8000; do printf "."; sleep 10; done' |
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,28 +1,51 @@ | ||
name: Docker CI (release) | ||
name: Docker Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- dev | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_REGISTRY: ghcr.io | ||
IMAGE_PATH: ${{ github.repository }} | ||
IMAGE_TAG: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
- name: Get latest release | ||
id: latest_release | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
repository: ${{ github.repository }} | ||
excludes: prerelease, draft | ||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push docker | ||
run: | | ||
docker build -f ./Dockerfile . --tag ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:${{ env.RELEASE_VERSION }} --tag ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:latest | ||
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:${{ env.RELEASE_VERSION }} | ||
docker push ${{ env.REGISTRY }}/fsr5-fhaachen/strichlistensystem:latest | ||
- name: Build and push (latest release) | ||
uses: docker/build-push-action@v6 | ||
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release == github.ref_name }} # run only on latest release | ||
with: | ||
push: true | ||
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}, ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest | ||
- name: Build and push (release) | ||
uses: docker/build-push-action@v6 | ||
if: ${{ github.event_name == 'release' && steps.latest_release.outputs.release != github.ref_name }} # run only on release (not latest) | ||
with: | ||
push: true | ||
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} | ||
- name: Build and push (push) | ||
uses: docker/build-push-action@v6 | ||
if: ${{ github.event_name == 'push' }} # run only on push (to dev) | ||
with: | ||
push: true | ||
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} |
Oops, something went wrong.