Skip to content

ci: fix release outputs #27

ci: fix release outputs

ci: fix release outputs #27

Workflow file for this run

name: ci
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
env:
IMAGE_NAME: virtool/iimi
REGISTRY: ghcr.io
jobs:
release:
runs-on: ubuntu-22.04
if: github.event_name == 'push'
outputs:
git-tag: ${{ steps.release.outputs.git-tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install semantic-release
run: npm i semantic-release@v23.0.0 @semantic-release/exec@v6.0.3 conventional-changelog-conventionalcommits@7.0.2
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
ghcr:
runs-on: ubuntu-22.04
if: github.repository_owner == 'Virtool' && github.event_name == 'push' && needs.release.outputs.git-tag != ''
needs: [release]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.release.outputs.git-tag }}
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
context: git
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
- name: Build and Push
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}