From 5ebea165187ca2feaf14745a0deb6c287ce1202f Mon Sep 17 00:00:00 2001 From: Aaron Elkiss Date: Mon, 6 Jan 2025 17:12:48 -0500 Subject: [PATCH] Update github actions for holdings-mariadb --- .github/workflows/build.yml | 9 ++------- .github/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/tag-release.yml | 4 ++-- 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66babb76..4fa07480 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,6 @@ name: Build on: - workflow_run: - workflows: ['Run Tests'] - branches: ['main'] - types: [completed] - workflow_dispatch: inputs: img_tag: @@ -40,9 +35,9 @@ jobs: steps: - name: Build Image - uses: hathitrust/github_actions/build@v1.4.0 + uses: hathitrust/github_actions/build@v1 with: - image: ghcr.io/hathitrust/holdings-client-unstable + image: ghcr.io/hathitrust/holdings-mariadb img_tag: ${{ inputs.img_tag }} tag: ${{ inputs.ref }} push_latest: ${{ inputs.push_latest}} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..1aef4605 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Deploy + +on: + workflow_dispatch: + inputs: + branch_hash: + description: Branch hash (default) or revision to deploy + environments: + description: The environment to deploy to + type: choice + default: testing + options: + - testing + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Deploy to ${{inputs.environments}} + uses: hathitrust/github_actions/deploy@v1 + with: + image: ghcr.io/hathitrust/holdings-mariadb:${{ inputs.branch_hash || github.sha}} + file: environments/holdings-mariadb/${{inputs.environments}}/holdings-client-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/tag-release.yml b/.github/workflows/tag-release.yml index a2a7e9aa..4686bd05 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -11,6 +11,6 @@ jobs: - uses: hathitrust/github_actions/tag-release@v1 with: registry_token: ${{ github.token }} - existing_tag: ghcr.io/hathitrust/holdings-client-unstable:${{ github.sha }} - image: ghcr.io/hathitrust/holdings-client + existing_tag: ghcr.io/hathitrust/holdings-mariadb:${{ github.sha }} + image: ghcr.io/hathitrust/holdings-mariadb new_tag: ${{ github.event.release.tag_name }}