Skip to content

Commit

Permalink
Use our own github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aelkiss committed May 2, 2024
1 parent 1f1d6e2 commit 14136df
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 27 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,51 @@
name: Build A Branch

on:
workflow_run:
workflows: ['Run Tests']
branches: ['master']
types: [completed]

workflow_dispatch:
inputs:
img_tag:
description: Docker Image Tag
ref:
description: Revision or Branch to build
default: master
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

jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Build Image
uses: hathitrust/github_actions/build@v1.4.0
with:
image: ghcr.io/${{ github.repository }}-unstable
dockerfile: Dockerfile
img_tag: ${{ inputs.img_tag }}
tag: ${{ inputs.ref }}
push_latest: ${{ inputs.push_latest}}
registry_token: ${{ github.token }}
rebuild: ${{ inputs.rebuild }}
16 changes: 16 additions & 0 deletions .github/workflows/tag-release.yml
@@ -0,0 +1,16 @@
name: Docker Tag Latest Release

on:
release:
types: [released]

jobs:
tag-release:
runs-on: ubuntu-latest
steps:
- uses: hathitrust/github_actions/tag-release@v1
with:
registry_token: ${{ github.token }}
existing_tag: ghcr.io/${{ github.repository }}-unstable:${{ github.sha }}
image: ghcr.io/${{ github.repository }}
new_tag: ${{ github.event.release.tag_name }}
28 changes: 1 addition & 27 deletions .github/workflows/ci.yaml → .github/workflows/tests.yml
@@ -1,4 +1,4 @@
name: CI
name: Run Tests

on:
push:
Expand Down Expand Up @@ -149,29 +149,3 @@ jobs:

- name: Lint
run: make lint

artifacts:
name: Artifacts
uses: ./.github/workflows/artifacts.yaml
with:
publish: ${{ github.event_name == 'push' }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
permissions:
contents: read
packages: write
id-token: write
security-events: write

dependency-review:
name: Dependency review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Dependency Review
uses: actions/dependency-review-action@5bbc3ba658137598168acb2ab73b21c432dd411b # v4.2.5

0 comments on commit 14136df

Please sign in to comment.