chore(docker,ci): bump nginx to 1.30.6-trixie and migrate CI to Gitea registry
Continuous Integration / docker-build-and-push (push) Successful in 53s

This commit is contained in:
Lucas Winther committed 2026-11-09 09:07:40 +01:00
1 parent 760cd33c3f
commit eb833ad3bf
3 files changed
+66 -48

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
name: Continuous Integration
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
env:
REGISTRY: gitea.lucaswinther.info
jobs:
docker-build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Scope Node 14 to the build step so subsequent Node 20+ JS actions are unaffected.
# The Dockerfile copies ./build into nginx, so the static build runs before docker build.
- name: Build React application
env:
NODE_VERSION: v14.21.3
run: |
case "$(uname -m)" in
x86_64) arch=x64 ;;
aarch64) arch=arm64 ;;
*) echo "::error::Unsupported runner architecture $(uname -m)"; exit 1 ;;
esac
curl -fsSL "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${arch}.tar.gz" \
| tar -xz -C "${RUNNER_TEMP:-/tmp}"
export PATH="${RUNNER_TEMP:-/tmp}/node-${NODE_VERSION}-linux-${arch}/bin:$PATH"
npm ci
npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Gitea's job token cannot publish packages; use a package-write PAT.
- name: Log in to Gitea Container Registry
if: gitea.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: lucasw89
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/lucasw89/chess-swap-frontend
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=semver,pattern={{version}}
type=sha,prefix=sha-
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-47
View File
@@ -1,47 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4
- name: Install required components
run: npm install
# Runs a single command using the runners shell
- name: use react-scripts to create optimized build
run: npm run build
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish changed images
uses: dawidd6/action-docker-publish-changed@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
platforms: linux/amd64,linux/arm64,linux/arm
tag: latest
+1 -1
View File
@@ -1,2 +1,2 @@
FROM nginx:latest
FROM nginx:1.30.6-trixie
COPY ./build /usr/share/nginx/html