mirror of
https://github.com/chevereto/chevereto.git
synced 2026-05-06 07:45:48 +02:00
Automatic push 4.0.5
This commit is contained in:
102
.github/workflows/docker.yml
vendored
Normal file
102
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
env:
|
||||
GHCR_SLUG: ghcr.io/${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
php: ["8.1"]
|
||||
name: Build on PHP ${{ matrix.php }} ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get current branch
|
||||
id: get-branch
|
||||
run: |
|
||||
raw=$(git branch -r --contains ${{ github.ref }})
|
||||
echo "branch=${raw##*/}" >> $GITHUB_OUTPUT
|
||||
- run: echo ${{ steps.get-branch.outputs.branch }}
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
${{ env.GHCR_SLUG }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
labels: |
|
||||
org.opencontainers.image.title=Chevereto V4
|
||||
org.opencontainers.image.description=Ultimate image sharing software 🦄
|
||||
org.opencontainers.image.vendor=Chevereto
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build dependencies
|
||||
run: composer install --no-progress --ignore-platform-reqs
|
||||
working-directory: app
|
||||
- name: Build Chevereto
|
||||
run: |
|
||||
app/bin/legacy -C langs
|
||||
app/bin/legacy -C htaccess-checksum
|
||||
app/bin/legacy -C htaccess-enforce
|
||||
- name: Packaging
|
||||
run: |
|
||||
rm -rf .git .gitignore .github .ecs .vscode
|
||||
rm -rf README.md chevereto.svg rector.php
|
||||
rm -rf app/tests app/phpunit*.xml
|
||||
rm -rf app/.editions app/bin/edition
|
||||
mkdir importing/{parse-users,parse-albums,no-parse}
|
||||
mv .package ..
|
||||
ls -la ../.package
|
||||
- name: Checkout chevereto/docker
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: chevereto/docker
|
||||
path: docker
|
||||
ref: ${{ steps.get-branch.outputs.branch }}
|
||||
- run: |
|
||||
mv docker ../docker
|
||||
mkdir -p ../docker/chevereto
|
||||
ls -la ../docker
|
||||
- name: Copy to docker folder
|
||||
run: |
|
||||
cp -a ./. ../docker/chevereto/
|
||||
ls -la ../docker/chevereto
|
||||
- name: Build
|
||||
uses: docker/bake-action@v2
|
||||
with:
|
||||
workdir: ../docker
|
||||
set: build.args.PHP=${{ matrix.php }}
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
targets: build
|
||||
push: true
|
||||
- name: Check manifest
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
85
.github/workflows/release.yml
vendored
Normal file
85
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: [ubuntu-latest]
|
||||
php-versions: ["8.1"]
|
||||
env:
|
||||
tools: composer
|
||||
ini-values: default_charset='UTF-8'
|
||||
key: cache-1633608016315
|
||||
name: Release on PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
ini-values: ${{ env.ini-values }}
|
||||
tools: ${{ env.tools }}
|
||||
env:
|
||||
fail-fast: true
|
||||
- name: Validate composer
|
||||
run: composer validate
|
||||
working-directory: app
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
working-directory: app
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
- name: Build dependencies
|
||||
run: composer install --no-progress --ignore-platform-reqs
|
||||
working-directory: app
|
||||
- name: Build Chevereto
|
||||
run: |
|
||||
app/bin/legacy -C langs
|
||||
app/bin/legacy -C htaccess-checksum
|
||||
app/bin/legacy -C htaccess-enforce
|
||||
- name: Packaging
|
||||
run: |
|
||||
rm -rf .git .gitignore .github .ecs .vscode
|
||||
rm -rf README.md chevereto.svg rector.php
|
||||
rm -rf app/tests app/phpunit*.xml
|
||||
rm -rf app/.editions app/bin/edition
|
||||
mkdir importing/{parse-users,parse-albums,no-parse}
|
||||
mv .package ..
|
||||
ls -la ../.package
|
||||
- name: Archive lite
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
directory: "."
|
||||
type: "zip"
|
||||
filename: "${{ github.ref_name}}-lite.zip"
|
||||
exclusions: "/*app/vendor/*"
|
||||
- name: Archive release
|
||||
uses: thedoctor0/zip-release@master
|
||||
with:
|
||||
directory: "."
|
||||
type: "zip"
|
||||
filename: "${{ github.ref_name}}.zip"
|
||||
exclusions: "${{ github.ref_name}}-lite.zip"
|
||||
- name: Upload artifacts
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
removeArtifacts: true
|
||||
bodyFile: "../.package/${{ github.ref_name}}.txt"
|
||||
artifacts: >
|
||||
../.package/${{ github.ref_name}}.txt,
|
||||
${{ github.ref_name}}.zip,
|
||||
${{ github.ref_name}}-lite.zip
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user