Release LAPIS #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release LAPIS | |
on: | |
workflow_run: | |
workflows: [LAPIS] | |
types: [completed] | |
branches: [main] | |
env: | |
LAPIS_DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis | |
DOCS_DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis-docs | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
checks: read | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'GenSpectrum/LAPIS' }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
path: . | |
config-file: release-please-config.json | |
manifest-file: .release-please-manifest.json | |
include-component-in-tag: true | |
target-branch: main | |
- name: Inspect Release Outputs | |
run: | | |
cat <<'EOF' | |
${{ toJson(steps.release.outputs) }} | |
EOF | |
- uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Set up Docker Buildx | |
if: ${{ steps.release.outputs.release_created }} | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
if: ${{ steps.release.outputs.release_created }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Wait for Lapis Docs Docker Image | |
if: ${{ steps.release.outputs.release_created }} | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.sha }} | |
check-name: Build Docs Docker Image And Run E2E Tests | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker metadata | |
if: ${{ steps.release.outputs.release_created }} | |
id: dockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.LAPIS_DOCKER_IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} | |
type=raw,value=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} | |
- name: Build and push LAPIS image | |
if: ${{ steps.release.outputs.release_created }} | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./lapis | |
tags: ${{ steps.dockerMetadata.outputs.tags }} | |
cache-from: type=gha,scope=lapis-${{ github.ref }} | |
cache-to: type=gha,mode=max,scope=lapis-${{ github.ref }} | |
platforms: ${{ github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | |
push: true | |
build-args: | | |
VERSION=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} | |
- name: Docs Docker metadata | |
if: ${{ steps.release.outputs.release_created }} | |
id: docsDockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCS_DOCKER_IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} | |
type=raw,value=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} | |
- name: Build and push LAPIS Docs image | |
if: ${{ steps.release.outputs.release_created }} | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./lapis-docs | |
push: true | |
tags: ${{ steps.docsDockerMetadata.outputs.tags }} | |
cache-from: type=gha,scope=lapis-docs-${{ github.ref }} | |
cache-to: type=gha,mode=max,scope=lapis-docs-${{ github.ref }} | |
build-args: | | |
VERSION=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} |