summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-02 12:17:39 +0300
committerAndrew Dolgov <[email protected]>2023-04-02 12:17:39 +0300
commitd3f980d72679a7a6a4d6989acbe062208e1b655c (patch)
treeb2e8cb4708244627dbf7f63caa9c97fbe916d777
parent9bc38424878e1842fa3a33c8f3b8be33feaf5442 (diff)
switch to gitlab ci
-rw-r--r--.gitea/workflows/build.yml117
-rw-r--r--.gitea/workflows/lint.yaml27
-rw-r--r--.gitlab-ci.yml32
3 files changed, 32 insertions, 144 deletions
diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
deleted file mode 100644
index 7d55f63..0000000
--- a/.gitea/workflows/build.yml
+++ /dev/null
@@ -1,117 +0,0 @@
-# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
-
-name: build
-
-on:
- push:
- branches:
- - "master"
- workflow_dispatch: {}
-
-defaults:
- run:
- shell: sh
-
-jobs:
- build:
- runs-on: alpine-3.16
- steps:
- - uses: https://gitea.com/actions/checkout@v3
-
- - name: eslint
- run: npx eslint js
-
- - run: rm -rf node_modules
-
- - name: phpstan
- run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
-
- - name: setup qemu
- uses: https://github.com/docker/setup-qemu-action@v2
-
- - name: setup buildx
- uses: https://github.com/docker/setup-buildx-action@v2
-
- - name: login to registry
- uses: https://github.com/docker/login-action@v2
- with:
- registry: ${{ secrets.REGISTRY_HOST }}
- username: ${{ secrets.REGISTRY_USER }}
- password: ${{ secrets.REGISTRY_PASSWORD }}
-
- - name: login to docker hub
- uses: https://github.com/docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_HUB_USER }}
- password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
- - name: get docker meta for web-nginx
- id: meta_web_nginx
- uses: https://github.com/docker/metadata-action@v4
- with:
- images: |
- ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-web-nginx
- cthulhoo/the-epube-web-nginx
- tags: |
- type=sha,prefix={{ date 'YY.MM-' tz='UTC'}}
- type=raw,value=latest,enable={{ is_default_branch }}
-
- - name: build web-nginx image
- uses: https://github.com/docker/build-push-action@v4
- with:
- push: true
- platforms: linux/amd64,linux/arm64,linux/arm/v7
- context: .docker/web-nginx
- tags: ${{ steps.meta_web_nginx.outputs.tags }}
- labels: ${{ steps.meta_web_nginx.outputs.labels }}
- provenance: false
- cache-from: type=registry,ref=${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-web-nginx:latest
- cache-to: type=inline
-
- - name: get docker meta for dict
- id: meta_dict
- uses: https://github.com/docker/metadata-action@v4
- with:
- images: |
- ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-dict
- cthulhoo/the-epube-dict
- tags: |
- type=sha,prefix={{ date 'YY.MM-' tz='UTC'}}
- type=raw,value=latest,enable={{ is_default_branch }}
-
- - name: build dict image
- uses: https://github.com/docker/build-push-action@v4
- with:
- push: true
- platforms: linux/amd64,linux/arm64,linux/arm/v7
- context: .docker/dict
- tags: ${{ steps.meta_dict.outputs.tags }}
- labels: ${{ steps.meta_dict.outputs.labels }}
- provenance: false
- cache-from: type=registry,ref=${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-dict:latest
- cache-to: type=inline
-
- - name: get docker meta for app
- id: meta_app
- uses: https://github.com/docker/metadata-action@v4
- with:
- images: |
- ${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-fpm-static
- cthulhoo/the-epube-fpm-static
- tags: |
- type=sha,prefix={{ date 'YY.MM-' tz='UTC'}}
- type=raw,value=latest,enable={{ is_default_branch }}
-
- - name: build app image
- uses: https://github.com/docker/build-push-action@v4
- with:
- push: true
- platforms: linux/amd64,linux/arm64,linux/arm/v7
- context: .docker/app
- build-contexts:
- app-src=.
- tags: ${{ steps.meta_app.outputs.tags }}
- labels: ${{ steps.meta_app.outputs.labels }}
- provenance: false
- cache-from: type=registry,ref=${{ secrets.REGISTRY_HOST }}/cthulhoo/the-epube-fpm-static:latest
- cache-to: type=inline
diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml
deleted file mode 100644
index 0a8e7df..0000000
--- a/.gitea/workflows/lint.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
-
-name: lint
-
-on:
- push:
- branches:
- - "!master"
- pull_request: {}
-
-defaults:
- run:
- shell: sh
-
-jobs:
- lint:
- runs-on: alpine-3.16
- steps:
- - name: checkout source
- uses: actions/checkout@v3
-
- - name: eslint
- run: npx eslint js
-
- - name: phpstan
- run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
-
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..35df718
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,32 @@
+stages:
+ - lint
+ - build
+
+include:
+ - project: 'git/ci-templates'
+ ref: master
+ file: .ci-build-docker.yml
+ - project: 'git/ci-templates'
+ ref: master
+ file: .ci-lint-common.yml
+
+eslint:
+ extends: .eslint
+
+phpstan:
+ extends: .phpstan
+
+the-epube-dict:
+ extends: .build-master
+ variables:
+ BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/dict
+
+the-epube-fpm-static:
+ extends: .build-master
+ variables:
+ BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/app
+
+the-epube-web-nginx:
+ extends: .build-master
+ variables:
+ BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/web-nginx