From 0f2b6fdb8b6f6d09e2fba940801a2280f2e17c4b Mon Sep 17 00:00:00 2001 From: K'Ron Spar Date: Thu, 26 Sep 2024 14:28:04 -0400 Subject: [PATCH] Added basic individual test, build, and deploy workflows. --- .github/workflows/build.yml | 46 ++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 32 +++++++++++++++++++++++++ .github/workflows/test.yml | 14 +++++++++++ 3 files changed, 92 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ed2bd54 --- /dev/null +++ b/.github/workflows/build.yml @@ -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/build@v1.4.0 + 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 }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..4ad2da7 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a948ece --- /dev/null +++ b/.github/workflows/test.yml @@ -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!"