Skip to content

Commit

Permalink
Added basic individual test, build, and deploy workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronster2018 committed Sep 26, 2024
1 parent 59cd22b commit 0f2b6fd
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on:
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

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

steps:
- name: Build Image
uses: hathitrust/github_actions/[email protected]
with:
image: ghcr.io/${{ github.repository }}
dockerfile: Dockerfile
img_tag: ${{ inputs.img_tag }}
tag: ${{ inputs.ref }}
push_latest: ${{ inputs.push_latest}}
registry_token: ${{ github.token }}
rebuild: ${{ inputs.rebuild }}
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
workflow_dispatch:
inputs:
branch_hash:
description: Revision or Branch to build
default: main
environments:
description: The environment to deploy to
type: choice
default: linux/amd64,linux/arm64
options:
- testing
- staging
- production

jobs:
deploy-unstable:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Deploy to workshop
uses: hathitrust/github_actions/deploy@DEV-1150
with:
image: ghcr.io/${{ github.repository }}${{ inputs.branch_hash }}
file: environments/${{ github.event.repository.name }}/${{inputs.environments}}/web-image.txt
CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }}
CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }}
CONFIG_REPO_RW_KEY: ${{secrets.CONFIG_REPO_RW_KEY}}
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run Tests

on:
push:
branches:
- main
workflow_dispatch:

jobs:
test-image:
runs-on: ubuntu-latest
steps:
- name: Simple Test
run: echo "Testing!"

0 comments on commit 0f2b6fd

Please sign in to comment.