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

Action updates #11

Merged
merged 8 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
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
36 changes: 0 additions & 36 deletions .github/workflows/build-manual.yaml

This file was deleted.

87 changes: 46 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
name: Build A Branch
name: Build

on:
workflow_run:
workflows: ['Run Tests']
branches: ['main']
types: [completed]
workflow_dispatch:
inputs:
tag:
description: Release or Tag
required: true
push_latest:
description: Set True if the build is for the latest version
type: boolean
required: false
default: false
workflow_run:
workflows: ['Run Tests']
branches: ['main']
types: [completed]

jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
workflow_dispatch:
inputs:
img_tag:
description: Docker Image Tag
ref:
description: Revision or Branch to build
default: main
push_latest:
description: Set True if the build is for the latest version
type: boolean
required: false
default: false
platforms:
description: Platforms to build for
type: choice
default: linux/amd64,linux/arm64
options:
- linux/amd64,linux/arm64
- linux/amd64
- linux/arm64
rebuild:
description: Rebuild this image?
type: boolean
default: false

steps:
- name: Set Inputs
id: set_inputs
run: |
if [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "tag=${{ github.sha }}" >> $GITHUB_ENV
echo "push_latest=true" >> $GITHUB_ENV
else
# workflow_dispatch or other trigger
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "push_latest=${{ github.event.inputs.push_latest }}" >> $GITHUB_ENV
fi
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

- name: Build Image
uses: hathitrust/github_actions/build@action-updates
with:
image: ghcr.io/hathitrust/ht-indexer
dockerfile: Dockerfile
tag: ${{ env.tag }}
push_latest: ${{ env.push_latest}}
registry_token: ${{ github.token }}
steps:
- name: Build Image
uses: hathitrust/github_actions/[email protected]
with:
image: ghcr.io/hathitrust/ht-indexer
dockerfile: Dockerfile
img_tag: ${{ inputs.img_tag }}
tag: ${{ inputs.ref }}
push_latest: ${{ inputs.push_latest}}
registry_token: ${{ github.token }}
rebuild: ${{ inputs.rebuild }}
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up tests
run: |
docker-compose build
docker compose build

- name: Run tests
run: docker-compose run test
run: docker compose run test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,5 @@ Use this curl command to query Sorl
``curl http://localhost:9033/solr/catalog/query -d 'json={"query":"ht_id:umn.31951000662660j"}'``

``poetry run python main.py --host 0.0.0.0 --port 8081 --solr_host localhost --solr_port 8983``

# Another temporary change to remove