Skip to content

Commit

Permalink
Tidy #185, test alpha and update some action versions
Browse files Browse the repository at this point in the history
  • Loading branch information
d7415 committed Feb 14, 2024
1 parent 522de9a commit acb0ed3
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 142 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,24 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
Expand Down Expand Up @@ -149,7 +148,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set Password
run: "sed -i 's/<.*_PASSWORD>/password/g' docker-compose.yml"
Expand Down
206 changes: 206 additions & 0 deletions .github/workflows/nightly-alpha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Nightly Alpha Build

on:
schedule:
- cron: '46 20 * * *'
workflow_dispatch:

env:
PUID: '1000'
PGID: '1000'
PHP_TZ: 'UTC'

jobs:
build-nightly:
runs-on: ubuntu-latest
steps:
-
name: Checkout
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 DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
build-args: |
BRANCH=alpha
tags: |
lycheeorg/lychee:testing-${{ github.run_id }}
devtools:
runs-on: ubuntu-latest
steps:
-
name: Checkout
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 DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
build-args: |
COMPOSER_NO_DEV=0
BRANCH=alpha
tags: |
lycheeorg/lychee:testing-${{ github.run_id }}-devtools
default-env:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
steps:
-
name: GET
run: 'curl -sSw "%{stderr}%{http_code}" http://localhost/ > /dev/null && curl -f http://localhost/'

sqlite:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
env:
DB_CONNECTION: sqlite
steps:
-
name: GET
run: 'curl -sSw "%{stderr}%{http_code}" http://localhost/ > /dev/null && curl -f http://localhost/'

sqlite2:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
env:
DB_CONNECTION: sqlite
DB_DATABASE: '/var/www/html/Lychee/nonexistent'
steps:
-
name: GET
run: 'curl -sSw "%{stderr}%{http_code}" http://localhost/ > /dev/null && curl -f http://localhost/'

mysql:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
db:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: lychee
env:
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: '3306'
DB_DATABASE: lychee
DB_USERNAME: root
DB_PASSWORD: password
steps:
-
name: GET
run: 'curl -sSw "%{stderr}%{http_code}" http://localhost/ > /dev/null && curl -f http://localhost/'

postgres:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
db:
image: postgres:latest
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: lychee
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DB_CONNECTION: pgsql
DB_HOST: db
DB_PORT: '5432'
DB_DATABASE: lychee
DB_USERNAME: postgres
DB_PASSWORD: password
steps:
-
name: GET
run: 'curl -sSw "%{stderr}%{http_code}" http://localhost/ > /dev/null && curl -f http://localhost/'

docker-compose:
needs: build-nightly
runs-on: ubuntu-latest
services:
lychee-docker:
image: lycheeorg/lychee:testing-${{ github.run_id }}
ports:
- 80:80
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set Password
run: "sed -i 's/<.*_PASSWORD>/password/g' docker-compose.yml"
-
name: Set Image
run: "sed -i 's|image: lycheeorg/lychee|image: lycheeorg/lychee:testing-${{ github.run_id }}|' docker-compose.yml"
-
name: Install docker-compose
run: "sudo apt install docker-compose"
-
name: Run docker-compose
run: 'docker-compose up -d && sleep 45 && docker-compose ps && curl -sSw "%{stderr}%{http_code}" http://localhost:90/ > /dev/null && curl -f http://localhost:90/'

retag-nightly:
needs: [default-env, sqlite, sqlite2, mysql, postgres, docker-compose, devtools]
runs-on: ubuntu-latest
container:
image: gcr.io/go-containerregistry/crane:debug
steps:
-
name: Retag image
run: |
crane auth login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} index.docker.io
crane tag lycheeorg/lychee:testing-${{ github.run_id }} alpha
crane tag lycheeorg/lychee:testing-${{ github.run_id }}-devtools alpha-devtools
Loading

0 comments on commit acb0ed3

Please sign in to comment.