2025-11-28 21:38:24 -05:00
|
|
|
name: Build and Push Docker Image
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build-and-push:
|
|
|
|
|
runs-on: ubuntu-latest
|
2025-11-30 21:01:54 -05:00
|
|
|
container:
|
|
|
|
|
image: docker:latest
|
2025-11-28 21:38:24 -05:00
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
2025-11-30 21:01:54 -05:00
|
|
|
run: |
|
|
|
|
|
apk add --no-cache git
|
|
|
|
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
|
|
|
|
git checkout ${{ github.sha }}
|
2025-11-28 21:38:24 -05:00
|
|
|
|
2025-11-30 21:01:54 -05:00
|
|
|
- name: Build Docker image
|
|
|
|
|
run: |
|
|
|
|
|
docker build -t forgejo.sivic.me/${{ github.repository }}:latest \
|
|
|
|
|
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} .
|
2025-11-28 21:38:24 -05:00
|
|
|
|
|
|
|
|
- name: Log in to Forgejo Container Registry
|
2025-11-30 21:01:54 -05:00
|
|
|
run: |
|
|
|
|
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
2025-11-28 21:38:24 -05:00
|
|
|
|
2025-11-30 21:01:54 -05:00
|
|
|
- name: Push Docker image
|
|
|
|
|
run: |
|
|
|
|
|
docker push forgejo.sivic.me/${{ github.repository }}:latest
|
|
|
|
|
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
|