2022-10-20 01:31:47 +03:00
|
|
|
name: Publish Collab Server Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- collab-v*
|
|
|
|
|
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
name: Publish collab server image
|
|
|
|
runs-on:
|
|
|
|
- self-hosted
|
|
|
|
- deploy
|
|
|
|
steps:
|
|
|
|
- name: Add Rust to the PATH
|
|
|
|
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Sign into DigitalOcean docker registry
|
|
|
|
run: doctl registry login
|
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
clean: false
|
2022-10-25 03:13:20 +03:00
|
|
|
submodules: 'recursive'
|
2022-10-20 01:31:47 +03:00
|
|
|
|
2022-10-26 20:32:30 +03:00
|
|
|
- name: Determine version
|
2022-10-20 01:31:47 +03:00
|
|
|
run: |
|
|
|
|
set -eu
|
2022-10-26 20:32:30 +03:00
|
|
|
version=$(script/get-crate-version collab)
|
|
|
|
if [[ $GITHUB_REF_NAME != "collab-v${version}" ]]; then
|
|
|
|
echo "release tag ${GITHUB_REF_NAME} does not match version ${version}"
|
2022-10-20 01:31:47 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-26 20:32:30 +03:00
|
|
|
echo "Publishing collab version: ${version}"
|
|
|
|
echo "COLLAB_VERSION=${version}" >> $GITHUB_ENV
|
2022-10-20 01:31:47 +03:00
|
|
|
|
|
|
|
- name: Build docker image
|
|
|
|
run: docker build . --tag registry.digitalocean.com/zed/collab:v${COLLAB_VERSION}
|
|
|
|
|
|
|
|
- name: Publish docker image
|
|
|
|
run: docker push registry.digitalocean.com/zed/collab:v${COLLAB_VERSION}
|