This commit is contained in:
37
.gitea/workflows/default.yaml
Normal file
37
.gitea/workflows/default.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: default
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Load variables from the .env file in the repository
|
||||
- name: Load .env variables
|
||||
run: |
|
||||
if [ -f .env ]; then
|
||||
grep -v '^#' .env >> $GITHUB_ENV
|
||||
else
|
||||
echo ".env file not found, skipping load."
|
||||
fi
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY_URL }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ env.AUTH_TOKEN }}
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build -t ${{ env.REGISTRY_URL }}/${{ github.repository }}:latest .
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker push ${{ env.REGISTRY_URL }}/${{ github.repository }}:latest
|
||||
Reference in New Issue
Block a user