github ci/cd
This commit is contained in:
parent
6f49705b73
commit
7fc6859f7e
32
.github/workflows/docker-publish.yml
vendored
Normal file
32
.github/workflows/docker-publish.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Build and Publish Multi-Architecture Hugo Site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push multi-platform image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_USERNAME }}/weetile.uk:latest
|
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
# Step 1: Build the Hugo site
|
||||
FROM klakegg/hugo:ext-alpine AS build-stage
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy all files to the working directory
|
||||
COPY . .
|
||||
|
||||
# Build the Hugo site
|
||||
RUN hugo --minify
|
||||
|
||||
# Step 2: Use an Apache httpd image to serve the site
|
||||
FROM httpd:2.4-alpine
|
||||
|
||||
# Copy the public folder from the build stage to the Apache document root
|
||||
COPY --from=build-stage /app/public/ /usr/local/apache2/htdocs/
|
||||
|
Loading…
x
Reference in New Issue
Block a user