24 lines
690 B
YAML
24 lines
690 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: runner
|
|
container: docker:24-git
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Build and push
|
|
run: |
|
|
# Login to Gitea registry
|
|
echo "${{ secrets.GITEATOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin
|
|
|
|
# Build the image
|
|
docker build -t ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest .
|
|
|
|
# Push to registry
|
|
docker push ${{ gitea.server_url }}/${{ gitea.repository_owner }}/hello-gitea:latest |