All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 15s
Change from GITEA_TOKEN to FORGEJO_TOKEN to match the configured repository secret. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
container: docker:latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Log in to Forgejo Container Registry
|
|
run: |
|
|
echo "Logging in as: ${{ github.actor }}"
|
|
echo "${{ secrets.FORGEJO_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
|
echo "Login exit code: $?"
|
|
|
|
- name: Build and push Docker images
|
|
run: |
|
|
docker build \
|
|
-t forgejo.sivic.me/${{ github.repository }}:latest \
|
|
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} \
|
|
.
|
|
docker push forgejo.sivic.me/${{ github.repository }}:latest
|
|
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "✅ Successfully built and pushed:"
|
|
echo " - forgejo.sivic.me/${{ github.repository }}:latest"
|
|
echo " - forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}"
|