Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manual triggering to github action #116

Merged
merged 3 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Code CI
on:
push:
pull_request:
workflow_dispatch:
env:
# The target python version, which must match the Dockerfile version
CONTAINER_PYTHON: "3.10"
Expand Down Expand Up @@ -122,11 +123,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
rjwills28 marked this conversation as resolved.
Show resolved Hide resolved

# image names must be all lower case
- name: Generate image repo name
run: echo IMAGE_REPOSITORY=ghcr.io/$(tr '[:upper:]' '[:lower:]' <<< "${{ github.repository }}") >> $GITHUB_ENV

# Fetch latest tag on this branch if manually triggered
- name: Fetch latest tag
if: github.event_name == 'workflow_dispatch'
run: echo "LATEST_TAG=git tag | sort --version-sort | tail -n1" >> $GITHUB_ENV

- name: Download wheel and lockfiles
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -173,10 +181,12 @@ jobs:
images: ${{ env.IMAGE_REPOSITORY }}
# Add the "edge" tag on all commits to the "integration" branch.
# Add the "latest" tag to repository tags only
# Add a version tag if workflow is manually triggered
tags: |
type=edge,branch=integration
type=ref,event=tag
type=raw,value=latest, enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{version}},value=${{ env.LATEST_TAG }},enable=${{github.event_name == 'workflow_dispatch'}}

- name: Push cached image to container registry
if: github.ref_type == 'tag' || github.ref_name == 'integration'
Expand Down
Loading