docker
Some checks failed
Build and Push Docker / build-and-push (push) Failing after 2m50s

This commit is contained in:
Oli Passey
2026-02-21 18:13:41 +00:00
parent 68cf0fcdc3
commit a9452c0afb
4 changed files with 61 additions and 0 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
.git
.gitignore
.gitea
README.md
scripts
node_modules
*.log

View 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
View 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

View File

@@ -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
{ {