38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Debug registry auth
|
|
run: |
|
|
echo "=== Token length ==="
|
|
echo "${#TOKEN}"
|
|
echo "=== Curl with basic auth ==="
|
|
curl -vsk -u "${{ gitea.actor }}:${TOKEN}" https://git.timothykim.net/v2/ 2>&1
|
|
echo ""
|
|
echo "=== Curl with REGISTRY_TOKEN ==="
|
|
curl -vsk -u "${{ gitea.actor }}:${REG_TOKEN}" https://git.timothykim.net/v2/ 2>&1
|
|
env:
|
|
TOKEN: ${{ gitea.token }}
|
|
REG_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Login to Gitea Registry
|
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.timothykim.net -u ${{ gitea.actor }} --password-stdin
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: git.timothykim.net/timothykim/static:latest
|