Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy build

on:
push:
branches: [ master ]

workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: "7.4"
version: 2

- name: Build
run: |
php7.4 vendor/bin/sculpin generate -vvv -n --env=prod > build_output.log
if grep -iq "notice\|error\|warning" build_output.log ; then return 1; fi

- name: Output
run: cat build_output.log

-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: phperspl/phpers-website:latest
6 changes: 2 additions & 4 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Test build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

workflow_dispatch:

jobs:
build:
test:
runs-on: ubuntu-20.04

steps:
Expand All @@ -27,4 +25,4 @@ jobs:
if grep -iq "notice\|error\|warning" build_output.log ; then return 1; fi

- name: Output
run: cat build_output.log
run: cat build_output.log
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
FROM php:7.4-alpine
FROM nginx:latest

RUN apk add --no-cache git curl
RUN curl -o /usr/bin/composer https://getcomposer.org/download/2.2.6/composer.phar
RUN chmod 755 /usr/bin/composer

VOLUME /app
WORKDIR /app
EXPOSE 8000

CMD ["/usr/bin/composer"]
RUN rm -r /usr/share/nginx/html
COPY output_prod /usr/share/nginx/html
Loading