mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
docker
This commit is contained in:
parent
18748f77ac
commit
c43869d255
34
.github/workflows/docker-1x.yml
vendored
Normal file
34
.github/workflows/docker-1x.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: Build and push Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 1.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
run: |
|
||||||
|
docker buildx build . \
|
||||||
|
-f docker/Dockerfile \
|
||||||
|
-t vitodeploy/vito:1.x \
|
||||||
|
--build-arg RELEASE=0 \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--push
|
@ -1,5 +1,9 @@
|
|||||||
|
ARG RELEASE=1
|
||||||
|
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
ENV RELEASE_ARG=$RELEASE
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
@ -29,7 +33,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
|||||||
# app
|
# app
|
||||||
RUN rm -rf /var/www/html
|
RUN rm -rf /var/www/html
|
||||||
RUN git clone -b 1.x https://github.com/vitodeploy/vito.git /var/www/html
|
RUN git clone -b 1.x https://github.com/vitodeploy/vito.git /var/www/html
|
||||||
RUN git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
|
RUN [ "$RELEASE_ARG" -eq 1 ] && git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
|
||||||
RUN composer install --no-dev --prefer-dist
|
RUN composer install --no-dev --prefer-dist
|
||||||
RUN chown -R www-data:www-data /var/www/html \
|
RUN chown -R www-data:www-data /var/www/html \
|
||||||
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache
|
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||||
|
Loading…
x
Reference in New Issue
Block a user