Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 3s
Run the job in a docker:latest container which has Docker pre-installed, avoiding the need to install it manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1 KiB
YAML
33 lines
1 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
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Forgejo Container Registry
|
|
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
|
|
|
- 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 }}"
|