Update Builder

This commit is contained in:
2022-03-07 20:22:25 +00:00
committed by GitHub
parent b6e12e24ab
commit 66006eea99
2 changed files with 51 additions and 32 deletions

View File

@@ -11,55 +11,60 @@ env:
IMAGE_NAME: blog
jobs:
deploy:
runs-on: ubuntu-18.04
strategy:
matrix:
CPU_ARCH:
- arm64
- x86_64
Build_x86:
runs-on: ubuntu-latest
# If running with act, Uncomment below
container: phaze9/action-runner
# container: phaze9/action-runner
env:
DOCKER_CONFIG: $HOME/.docker
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.83.1'
extended: true
- name: Build
run: cd src && hugo --minify --destination build/
- name: Setup Docker
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_OWNER }}
password: ${{ secrets.TOKEN }}
- name: Build and push - x64
- name: Build and push
id: docker_build_x64
uses: docker/build-push-action@v2
if: ${{ matrix.CPU_ARCH == 'x86_64'}}
with:
push: true
platforms: linux/amd64
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:x64-latest
- name: Build and push - arm64
Build_ARM64:
runs-on: [self-hosted, linux, ARM64]
# If running with act, Uncomment below
# container: phaze9/action-runner
env:
DOCKER_CONFIG: $HOME/.docker
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_OWNER }}
password: ${{ secrets.TOKEN }}
- name: Build and push
id: docker_build_arm64
uses: docker/build-push-action@v2
if: ${{ matrix.CPU_ARCH == 'arm64'}}
with:
push: true
platforms: linux/arm64
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm-latest
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm64-latest

14
docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
version: "3"
services:
blog.fluttershub.com:
image: ghcr.io/fluttershub/blog:arm64-latest
restart: always
networks:
- external
container_name: blog.fluttershub.com
labels:
- "traefik.enable=true"
networks:
external:
external: true