Unified email reports
This commit is contained in:
62
.gitea/workflows/build-push.yml
Normal file
62
.gitea/workflows/build-push.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
name: Build and Push to Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
shell: sh
|
||||
run: |
|
||||
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git /workspace/repo
|
||||
cd /workspace/repo
|
||||
git checkout $GITHUB_REF_NAME
|
||||
|
||||
- name: Extract version from tag
|
||||
shell: sh
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Docker image
|
||||
shell: sh
|
||||
run: |
|
||||
cd /workspace/repo
|
||||
docker build -t email_reports_crew:${VERSION} .
|
||||
docker tag email_reports_crew:${VERSION} email_reports_crew:latest
|
||||
|
||||
- name: Login to Docker Registry
|
||||
shell: sh
|
||||
env:
|
||||
REGISTRY_URL: ${{ secrets.REGISTRY_URL }}
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin $REGISTRY_URL
|
||||
|
||||
- name: Tag and Push images
|
||||
shell: sh
|
||||
env:
|
||||
REGISTRY_URL: ${{ secrets.REGISTRY_URL }}
|
||||
run: |
|
||||
docker tag email_reports_crew:${VERSION} ${REGISTRY_URL}/email_reports_crew:${VERSION}
|
||||
docker tag email_reports_crew:${VERSION} ${REGISTRY_URL}/email_reports_crew:latest
|
||||
|
||||
docker push ${REGISTRY_URL}/email_reports_crew:${VERSION}
|
||||
docker push ${REGISTRY_URL}/email_reports_crew:latest
|
||||
|
||||
echo "✓ Pushed images:"
|
||||
echo " ${REGISTRY_URL}/email_reports_crew:${VERSION}"
|
||||
echo " ${REGISTRY_URL}/email_reports_crew:latest"
|
||||
|
||||
- name: Cleanup
|
||||
shell: sh
|
||||
run: |
|
||||
docker image prune -af
|
||||
echo "✓ Cleanup completed"
|
||||
Reference in New Issue
Block a user