Add README and CI pipeline for Docker image build and push to Gitea registry
Some checks failed
Build and Push Sandbox Base Image / build (push) Failing after 2m17s
Some checks failed
Build and Push Sandbox Base Image / build (push) Failing after 2m17s
This commit is contained in:
50
.gitea/workflows/ci.yml
Normal file
50
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Build and Push Sandbox Base Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.danhenry.dev:5050
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
git.danhenry.dev:5050/TheLab/sandbox-base-image:${{ github.sha }}
|
||||
git.danhenry.dev:5050/TheLab/sandbox-base-image:latest
|
||||
cache-from: type=registry,ref=git.danhenry.dev:5050/TheLab/sandbox-base-image:latest
|
||||
cache-to: type=registry,ref=git.danhenry.dev:5050/TheLab/sandbox-base-image:latest,mode=max
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Tag and push stable (main only)
|
||||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
||||
run: |
|
||||
docker tag git.danhenry.dev:5050/TheLab/sandbox-base-image:${{ github.sha }} git.danhenry.dev:5050/TheLab/sandbox-base-image:stable
|
||||
docker push git.danhenry.dev:5050/TheLab/sandbox-base-image:stable
|
||||
Reference in New Issue
Block a user