add git action workflow: build image, push to image registry

This commit is contained in:
nicholas
2025-06-14 21:18:28 -05:00
parent a05456f57f
commit a76fb5a821
13 changed files with 44 additions and 27 deletions
+37
View File
@@ -0,0 +1,37 @@
name: Deployment
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy-site:
name: 'deploy'
env:
REGISTRY_USERNAME: nicholas
IMAGE_REGISTRY: git.uuard.com
IMAGE_NAME: nicholas/personal-website
IMAGE_TAG: latest
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🔐 Gitea Registry Login
uses: docker/login-action@v3
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: 🐋 Build Docker image
run: docker build -t $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG ./container
- name: 🚀 Push Docker image
run: docker push $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG
- name: 🧹 Prune images
if: always()
run: docker image prune -f