43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Build and Push Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
|
|
DEPOT_PROJECT_ID: ${{ secrets.DEPOT_PROJECT_ID }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Depot CLI
|
|
run: |
|
|
curl -fsSL https://depot.dev/install-cli.sh | sh
|
|
echo "$HOME/.depot/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Configure Registry Auth
|
|
env:
|
|
REG_USER: nandi
|
|
REG_PASS: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
mkdir -p "$HOME/.docker"
|
|
AUTH=$(printf '%s:%s' "$REG_USER" "$REG_PASS" | base64 -w 0)
|
|
cat > "$HOME/.docker/config.json" <<EOF
|
|
{"auths":{"git.site.latha.org":{"auth":"${AUTH}"}}}
|
|
EOF
|
|
|
|
- name: Build and Push with Depot
|
|
run: |
|
|
SHORT_SHA="${GITHUB_SHA::8}"
|
|
depot build \
|
|
--project "$DEPOT_PROJECT_ID" \
|
|
--push \
|
|
-t "git.site.latha.org/experiments/gitea-k3s-deployer:${SHORT_SHA}" \
|
|
-t "git.site.latha.org/experiments/gitea-k3s-deployer:latest" \
|
|
.
|