Skip to content

Commit

Permalink
Merge pull request #11 from hathitrust/action-updates
Browse files Browse the repository at this point in the history
Action updates
  • Loading branch information
Ronster2018 authored Mar 26, 2024
2 parents bc9d58f + 287f61c commit cac61ff
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 80 deletions.
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 @@ -339,3 +339,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

0 comments on commit cac61ff

Please sign in to comment.