@@ -0,0 +1,23 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request: ~
|
||||||
|
workflow_dispatch: ~
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Docker Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Lint Dockerfile
|
||||||
|
uses: hadolint/[email protected]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: Publish_on_Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- devbuild_*
|
||||||
|
workflow_dispatch: ~
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build and Push
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to local registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{vars.REGISTRY_INSTANCE}}
|
||||||
|
username: ${{gitea.repository_owner}}
|
||||||
|
password: ${{secrets.REGISTRY_TOKEN}} # It should be a user/org token with package perms.
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{vars.REGISTRY_INSTANCE}}/${{gitea.repository_owner}}/somniarooms:devbuild
|
||||||
|
target: frankenphp_prod
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
secrets: |
|
||||||
|
GIT_AUTH_TOKEN=${{secrets.REGISTRY_TOKEN}}
|
||||||
@@ -22,4 +22,18 @@ docker compose --env-file .\.env.local up -d --wait
|
|||||||
Stop containers
|
Stop containers
|
||||||
```
|
```
|
||||||
docker compose down --remove-orphans
|
docker compose down --remove-orphans
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Prod:
|
||||||
|
|
||||||
|
You can use docker compose for prod or build and deploy a prod image.
|
||||||
|
|
||||||
|
**Build Prod image**
|
||||||
|
```
|
||||||
|
docker build -t somniarooms:prod --target frankenphp_prod .
|
||||||
|
```
|
||||||
|
|
||||||
|
**Deploy prod image**
|
||||||
|
```
|
||||||
|
docker run -d -it -p 80:80 -p 443:443 --name somniarooms --env-file ./env.prod.local somniarooms:prod
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user