Skip to content

Commit

Permalink
Update release strategy
Browse files Browse the repository at this point in the history
1. Manual deploy using a workflow dispatch
2. Successful deploys create a release version
3. Docker build & push triggered by after release is created
  • Loading branch information
cachapa committed Feb 5, 2024
1 parent 46d36dc commit dd95b90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Deploy

on:
push:
branches:
- 'release'
workflow_dispatch

concurrency:
group: "deploy"
cancel-in-progress: true

permissions:
packages: write # Required for calling the docker workflow
contents: write # Required for creating releases

jobs:
Expand Down Expand Up @@ -52,3 +49,9 @@ jobs:
with:
tag_name: "v${{ github.run_number }}"
release_name: "v${{ github.run_number }}"

Docker:
uses: ./.github/workflows/docker.yml
needs: build
with:
version: "v${{ github.run_number }}"
16 changes: 7 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Build and Push Docker Images

on:
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
workflow_call:
inputs:
version:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ inputs.version }}-${{ github.ref }}
cancel-in-progress: true

permissions:
Expand All @@ -25,7 +23,7 @@ jobs:
- name: Determine ref
id: get-ref
run: |
input_ref="${{ inputs.ref }}"
input_ref=${{ inputs.version }}
github_ref="${{ github.sha }}"
ref="${input_ref:-$github_ref}"
echo "ref=$ref" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit dd95b90

Please sign in to comment.