This commit is contained in:
@@ -3,6 +3,10 @@ name: Build and Push Docker Image
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
IMAGE_NAME: gitea.umbra.mom/ciaran/football-competitiveness
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -21,10 +25,18 @@ jobs:
|
||||
-u "$REGISTRY_USER" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build image
|
||||
- name: Set up buildx
|
||||
run: |
|
||||
docker build -t gitea.umbra.mom/ciaran/football-competitiveness:latest .
|
||||
docker buildx create --name ci-builder --driver docker-container --use || docker buildx use ci-builder
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
- name: Push image
|
||||
- name: Build and push image (with cache)
|
||||
run: |
|
||||
docker push gitea.umbra.mom/ciaran/football-competitiveness:latest
|
||||
docker buildx build \
|
||||
--pull \
|
||||
--platform linux/amd64 \
|
||||
-t "${IMAGE_NAME}:latest" \
|
||||
--cache-from "type=registry,ref=${IMAGE_NAME}:buildcache" \
|
||||
--cache-to "type=registry,ref=${IMAGE_NAME}:buildcache,mode=max" \
|
||||
--push \
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user