attempting auto-build and push of containers
Some checks are pending
Build and Publish Docker Image / build (push) Waiting to run
Some checks are pending
Build and Publish Docker Image / build (push) Waiting to run
This commit is contained in:
parent
dab0903a8c
commit
1d903f0616
2 changed files with 69 additions and 0 deletions
21
.forgejo/variables.yml
Normal file
21
.forgejo/variables.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Required Variables for CI/CD Pipeline
|
||||
|
||||
# Variables (set in Forgejo repository settings under Variables)
|
||||
variables:
|
||||
FORGEJO_REGISTRY:
|
||||
description: "Your Forgejo registry URL (e.g., forgejo.yourdomain.com)"
|
||||
required: true
|
||||
|
||||
FORGEJO_OWNER:
|
||||
description: "Your Forgejo username or organization name"
|
||||
required: true
|
||||
|
||||
FORGEJO_USER:
|
||||
description: "Username for registry authentication"
|
||||
required: true
|
||||
|
||||
# Secrets (set in Forgejo repository settings under Secrets)
|
||||
secrets:
|
||||
FORGEJO_TOKEN:
|
||||
description: "Access token for Forgejo registry authentication"
|
||||
required: true
|
48
.forgejo/workflows/docker-build.yml
Normal file
48
.forgejo/workflows/docker-build.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags: [ 'v*' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ vars.FORGEJO_REGISTRY }}/${{ vars.FORGEJO_OWNER }}/personal-digital-asset-manager
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ vars.FORGEJO_REGISTRY }}
|
||||
username: ${{ vars.FORGEJO_USER }}
|
||||
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
Loading…
Add table
Add a link
Reference in a new issue