Skip to content

Commit

Permalink
Added deploy action. Removed usage of -unstable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronster2018 committed Dec 20, 2024
1 parent 06e4742 commit 59b64cb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Build

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

workflow_dispatch:
inputs:
img_tag:
Expand Down Expand Up @@ -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/${{ github.repository }}-unstable
image: ghcr.io/${{ github.repository }}
dockerfile: Dockerfile
img_tag: ${{ inputs.img_tag }}
tag: ${{ inputs.ref }}
Expand Down
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: Deploy

on:
workflow_dispatch:
inputs:
branch_hash:
description: Branch hash or revision to deploy
default: main
environments:
description: The environment to deploy to
type: choice
default: testing
options:
- testing
- staging
- production

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/${{ github.repository }}:${{ inputs.branch_hash }}
file: environments/${{ github.event.repository.name }}/${{inputs.environments}}/crms-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}}
3 changes: 1 addition & 2 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Docker Tag Latest Release

on:
Expand All @@ -12,6 +11,6 @@ jobs:
- uses: hathitrust/github_actions/tag-release@v1
with:
registry_token: ${{ github.token }}
existing_tag: ghcr.io/${{ github.repository }}-unstable:${{ github.sha }}
existing_tag: ghcr.io/${{ github.repository }}:${{ github.sha }}
image: ghcr.io/${{ github.repository }}
new_tag: ${{ github.event.release.tag_name }}

0 comments on commit 59b64cb

Please sign in to comment.