Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
rosven9856 committed May 22, 2024
1 parent 2e917f3 commit afd74f2
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 0 deletions.
Empty file added .dockerignore
Empty file.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PHP_VERSION=8.3.6-1
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PHP_VERSION=8.3.6-1
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
* text=auto

AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
LICENSE text
NEWS text
.editorconfig text
.gitattributes text
.gitconfig text

.env text
.env.example text
.env.ci text
.gitignore text
.dockerignore text
Dockerfile text
Makefile text
composer.json text eol=lf
*.md text diff=markdown
*.php text diff=php
*.sh text eol=lf
*.yml text
*.json text
25 changes: 25 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: issue

on:
issues:
types: [opened, edited, reopened]
issue_comment:
types: [created, edited]

jobs:
send_telegram_message:
name: send telegram message
runs-on: ubuntu-latest
steps:
- name: send telegram message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
Github. Opened or edited issue
Author: ${{ github.actor }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: tests

on:
pull_request: ~
push:
branches: ['*.*.x', 'master']

env:
BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{env.BRANCH}}

- run: cp .env.ci .env

- uses: falti/dotenv-action@master
id: dotenv

- uses: docker/setup-buildx-action@v3

- uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: |
PHP_VERSION=${{ steps.dotenv.outputs.PHP_VERSION }}
push: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea
/.env
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG PHP_VERSION

FROM rosven9856/php:$PHP_VERSION

RUN addgroup -g 1000 --system php
RUN adduser -G php --system -D -s /bin/sh -u 1000 php

RUN chown php:php /home/php
RUN chown php:php /usr/local/bin/composer

RUN mkdir /var/src
RUN chown -R php:php /var/src

WORKDIR /var/src

COPY ./src /var/src

RUN composer install

USER php

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### Building a composer package in GitHub Action
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

php /var/src/app.php
1 change: 1 addition & 0 deletions src/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
1 change: 1 addition & 0 deletions src/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit afd74f2

Please sign in to comment.