sops-decrypt/.gitea/workflows/build-and-push.yaml
Mark Kaulertz 48b6821ae1
Some checks failed
Build and Push SOPS Decrypt Image / build-and-push (push) Failing after 1m15s
add ci/cd pipeline
2025-06-20 10:52:39 +02:00

42 lines
1.3 KiB
YAML

name: Build and Push SOPS Decrypt Image
# This workflow runs on any push to the 'main' or 'master' branch
on:
push:
branches:
- main
- master
jobs:
build-and-push:
# Use a standard Linux runner
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Log in to the Gitea Container Registry
# It uses the secrets we created earlier.
- name: Log in to Gitea Registry
uses: docker/login-action@v3
with:
# Use '!<Gitea-instance-URL>' for the registry address
# Example: registry: gitea.yourcompany.com
registry: ${{ gitea.instance }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 3: Build the Docker image and push it to the registry
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
# The directory containing your Dockerfile
context: ./sops-init
# Push the image after building
push: true
# Define the tags for the image
tags: |
${{ gitea.instance }}/${{ gitea.repository_owner }}/sops-decrypt:latest
${{ gitea.instance }}/${{ gitea.repository_owner }}/sops-decrypt:${{ gitea.sha }}