Files
chore/.gitea/workflows/build.yaml
Ryan Kegel cc436798d1
Some checks failed
Gitea Actions Demo / build-and-push (push) Has been cancelled
added in gitea actions
2026-01-13 15:54:57 -05:00

51 lines
1.5 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is building the chore app 🚀
on:
push:
branches:
- master
- next
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Resolve Gitea Server IP
run: |
ip=$(getent hosts gitea-server | awk '{ print $1 }')
echo "$ip" > /tmp/gitea_ip.txt
cat /tmp/gitea_ip.txt
- name: Check out repository code
uses: actions/checkout@v3
- name: Determine Image Tag
id: vars
run: |
if [ "${{ gitea.ref }}" == "refs/heads/master" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=next" >> $GITHUB_OUTPUT
fi
- name: Build Docker Image
run: |
docker build -t gitea-server:3000/ryan/chore:${{ steps.vars.outputs.tag }} .
- name: Resolve Gitea Server IP
id: gitea_ip
run: |
ip=$(getent hosts gitea-server | awk '{ print $1 }')
echo "GITEA_IP=$ip" >> $GITHUB_ENV
sleep 5000
- name: Log in to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.GITEA_IP }}:3000 # Replace with your Gitea registry URL
username: ryan #${{ secrets.REGISTRY_USERNAME }} # Stored as a Gitea secret
password: 0x013h #${{ secrets.REGISTRY_TOKEN }} # Stored as a Gitea secret (use a PAT here)
- name: Push Image to Gitea Registry
run: |
docker push gitea-server:3000/ryan/chore:${{ steps.vars.outputs.tag }}