47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
name: Publish container image
|
|
|
|
on:
|
|
push:
|
|
|
|
env:
|
|
IMAGE: registry.brunner.ninja/feedc0de/immich-sync
|
|
|
|
jobs:
|
|
publish:
|
|
name: Build and push
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Quay
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: registry.brunner.ninja
|
|
username: ${{ secrets.QUAY_USERNAME }}
|
|
password: ${{ secrets.QUAY_TOKEN }}
|
|
|
|
- name: Build image
|
|
env:
|
|
COMMIT_SHA: ${{ gitea.sha }}
|
|
run: |
|
|
docker build \
|
|
--label "org.opencontainers.image.revision=${COMMIT_SHA}" \
|
|
--label "org.opencontainers.image.source=https://code.brunner.ninja/feedc0de/immich-sync" \
|
|
--tag "${IMAGE}:${COMMIT_SHA}" \
|
|
.
|
|
|
|
- name: Push commit tag
|
|
env:
|
|
COMMIT_SHA: ${{ gitea.sha }}
|
|
run: docker push "${IMAGE}:${COMMIT_SHA}"
|
|
|
|
- name: Push latest tag
|
|
if: gitea.ref == 'refs/heads/main'
|
|
env:
|
|
COMMIT_SHA: ${{ gitea.sha }}
|
|
run: |
|
|
docker tag "${IMAGE}:${COMMIT_SHA}" "${IMAGE}:latest"
|
|
docker push "${IMAGE}:latest"
|