Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 17s
- Remove GitHub Actions marketplace actions (uses directive) - Use shell commands instead for better compatibility - Switch from gitea context to github context variables - Use Docker container to run build commands Fixes YAML schema validation errors in Forgejo runner 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
973 B
YAML
33 lines
973 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker:latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
apk add --no-cache git
|
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t forgejo.sivic.me/${{ github.repository }}:latest \
|
|
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} .
|
|
|
|
- name: Log in to Forgejo Container Registry
|
|
run: |
|
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Push Docker image
|
|
run: |
|
|
docker push forgejo.sivic.me/${{ github.repository }}:latest
|
|
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
|