mirror of
https://github.com/chevereto/chevereto.git
synced 2026-05-06 20:57:02 +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 }}
|
||||
Reference in New Issue
Block a user