From a9452c0afb4ebd4759adacf0cc82b96472735108 Mon Sep 17 00:00:00 2001 From: Oli Passey Date: Sat, 21 Feb 2026 18:13:41 +0000 Subject: [PATCH] docker --- .dockerignore | 7 +++++++ .gitea/workflows/docker.yml | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 7 +++++++ README.md | 14 ++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitea/workflows/docker.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fc1e77f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +.gitea +README.md +scripts +node_modules +*.log diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 0000000..5436997 --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..799042e --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 51952b9..3e01048 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,20 @@ Open `index.html` directly in your browser, or use the optional local server scr ./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 ```json {