Files
ente/.github/workflows/server-publish.yml
Manav Rathi 182fd89356 [server] Retain published image commit as branch instead of tag
Overwriting tags is clunky (besides being generally discouraged). e.g. pulling
the overwritten tags locally requires `git fetch --force --tags`. So instead use
the branch `server/ghcr` to point to the commit from which the latest published
ghcr docker image has been built
2024-12-30 13:58:08 +05:30

45 lines
1.5 KiB
YAML

name: "Publish ghcr (server)"
on:
# Run manually, providing it the commit.
#
# To obtain the commit from the currently deployed museum, do:
# curl -s https://api.ente.io/ping | jq -r '.id'
#
# See server/docs/publish.md for more details.
workflow_dispatch:
inputs:
commit:
description: "Commit to publish the image from"
type: string
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit }}
- name: Build and push
uses: mr-smithers-excellent/docker-build-push@v6
with:
dockerfile: server/Dockerfile
directory: server
# Resultant package name will be ghcr.io/ente-io/server
image: server
registry: ghcr.io
enableBuildKit: true
multiPlatform: true
platform: linux/amd64,linux/arm64
buildArgs: GIT_COMMIT=${{ inputs.commit }}
tags: ${{ inputs.commit }}, latest
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update branch server/ghcr to point to source commit
run: |
git push -f origin HEAD:server/ghcr