damien fcb7da3cc7
Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Has been cancelled
Update .github/workflows/release.yaml
2025-02-27 05:38:31 +00:00

65 lines
1.6 KiB
YAML

name: Build and Push Docker Image to Gitea Registry
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test || true
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.d4m13n.dev
username: damienostler1@outlook.com # Store your Gitea registry username as a secret
password: ${{ secrets.PACKAGE_TOKEN }} # Store your Gitea registry token/password as a secret
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
# Full image name including Gitea Registry URL
images: git.d4m13n.dev/damien/personal-website
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true # Enable push to registry
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max