Skip to content

publish

publish #67

Workflow file for this run

name: publish
on:
# This triggers for any tag or branch creation. We'll filter for tags in the job.
create:
jobs:
# Build for release and publish amd64
amd64:
if: startsWith(github.ref, 'refs/tags/')
runs-on: buildjet-4vcpu-ubuntu-2204
concurrency:
group: ${{ github.ref }}-publish-amd64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-amd64 # two stage build, where test is run in the first stage
- run: make test-smoke-ci
- name: Push image to Docker hub
run: make docker-push-amd64
# Build for release and publish aarch64
aarch64:
if: startsWith(github.ref, 'refs/tags/')
runs-on: buildjet-4vcpu-ubuntu-2204-arm
concurrency:
group: ${{ github.ref }}-publish-aarch64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-aarch64 # two stage build, where test is run in the first stage
- run: make test-smoke-ci
- name: Push image to Docker hub
run: make docker-push-aarch64
# Publish manifest combining aarch64 and amd64 images
manifest:
runs-on: ubuntu-latest
needs: [ amd64, aarch64 ]
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-publish-manifest
# Publish release to Sentry allowing us to track more
sentry:
runs-on: ubuntu-latest
needs: [ manifest ]
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
echo "RELEASE_VERSION=$(git describe --tag --dirty --abbrev=7)" >> $GITHUB_ENV
- uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
version: ${{ env.RELEASE_VERSION }}
# Publish documentation
docs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CUSTOM_DOMAIN: sipi.io
CONFIG_FILE: docs/mkdocs.yml
REQUIREMENTS: docs/requirements.txt