This commit is contained in:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.gitea
|
||||||
|
README.md
|
||||||
|
scripts
|
||||||
|
node_modules
|
||||||
|
*.log
|
||||||
33
.gitea/workflows/docker.yml
Normal file
33
.gitea/workflows/docker.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Build and Push Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_HOST }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REGISTRY_HOST }}/${{ secrets.IMAGE_NAME }}:latest
|
||||||
|
${{ secrets.REGISTRY_HOST }}/${{ secrets.IMAGE_NAME }}:${{ github.sha }}
|
||||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM nginx:1.27-alpine
|
||||||
|
|
||||||
|
COPY ./index.html /usr/share/nginx/html/index.html
|
||||||
|
COPY ./styles.css /usr/share/nginx/html/styles.css
|
||||||
|
COPY ./app.js /usr/share/nginx/html/app.js
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
14
README.md
14
README.md
@@ -28,6 +28,20 @@ Open `index.html` directly in your browser, or use the optional local server scr
|
|||||||
./scripts/smoke.ps1
|
./scripts/smoke.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Docker build & push (Gitea Actions)
|
||||||
|
This repo includes a Gitea Actions workflow in `.gitea/workflows/docker.yml`.
|
||||||
|
|
||||||
|
### Required secrets
|
||||||
|
Set these in your Gitea repo secrets:
|
||||||
|
- `REGISTRY_HOST` (e.g. `dock.ptslondon.co.uk`)
|
||||||
|
- `REGISTRY_USERNAME`
|
||||||
|
- `REGISTRY_PASSWORD`
|
||||||
|
- `IMAGE_NAME` (e.g. `team/tiles`)
|
||||||
|
|
||||||
|
The workflow builds and pushes:
|
||||||
|
- `${REGISTRY_HOST}/${IMAGE_NAME}:latest`
|
||||||
|
- `${REGISTRY_HOST}/${IMAGE_NAME}:${GITHUB_SHA}`
|
||||||
|
|
||||||
## Pattern JSON format
|
## Pattern JSON format
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user