Some checks failed
Build and Deploy / build-and-push (push) Failing after 1m7s
REGISTRY_URL var was empty so docker login fell through to Docker Hub. Now strips protocol from gitea.server_url to get the registry hostname — no manual variable needed. docker-compose defaults to the known host. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set image tags
|
|
id: image
|
|
run: |
|
|
# Gitea's container registry lives on the same host as the Gitea instance
|
|
REGISTRY="${{ gitea.server_url }}"
|
|
REGISTRY="${REGISTRY#https://}"
|
|
REGISTRY="${REGISTRY#http://}"
|
|
IMAGE="${REGISTRY}/josh/sixflagssupercalendar"
|
|
SHA="${{ gitea.sha }}"
|
|
echo "registry=${REGISTRY}" >> "$GITHUB_OUTPUT"
|
|
echo "tag_latest=${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
|
echo "tag_sha=${IMAGE}:${SHA::8}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Log in to registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | \
|
|
docker login "${{ steps.image.outputs.registry }}" -u josh --password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build \
|
|
-t "${{ steps.image.outputs.tag_latest }}" \
|
|
-t "${{ steps.image.outputs.tag_sha }}" \
|
|
.
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push "${{ steps.image.outputs.tag_latest }}"
|
|
docker push "${{ steps.image.outputs.tag_sha }}"
|