Files
Gitea-docker-runner-test/.gitea/workflows/build-and-push.yaml
Grzegorz Matoga 98713fa4c3
Some checks failed
Build and Push Docker Image / build (push) Failing after 3s
wip
2025-07-24 18:22:09 +02:00

30 lines
1020 B
YAML

name: Build and Push Docker Image
on:
push:
branches: [ main ]
jobs:
build:
runs-on: runner
container: docker:24-git
steps:
- name: Clone repository
run: |
# Configure git to use the token
git config --global credential.helper store
echo "https://${{ gitea.actor }}:${{ secrets.GITEA_TOKEN }}@${{ gitea.server_url }}" > ~/.git-credentials
# Clone without credentials in URL
git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git .
git checkout ${{ gitea.sha }}
# Clean up credentials
rm ~/.git-credentials
- name: Build and push
run: |
echo "${{ secrets.GITEA_TOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin
docker build -t ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest .
docker push ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest