Skip to content

Commit

Permalink
AUT-250 - Missed that the deploy step also ran on merges to main. Mov…
Browse files Browse the repository at this point in the history
…ing monitor zip build to seperate workflow (#988)

* AUT-250 - Missed that the deploy step also ran on merges to main. Moving monitor zip build to seperate workflow.
* Switching to publish the release automatically if one doesn't exist yet
  • Loading branch information
alexcottner committed Sep 19, 2024
1 parent 87f241b commit 3b78727
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9a-z]+.[0-9a-z]+'

jobs:
monitor:
name: Build Monitor Lambda Zip
runs-on: ubuntu-22.04
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Build monitor
run: |
cd tools/autograph-monitor
make build
- name: Create release draft if a release doesn't exist yet
run: |
EXISTING_RELEASE=$(gh release view $GITHUB_REF_NAME --json="id" || echo '')
if [[ -z $EXISTING_RELEASE ]]; then
gh release create $GITHUB_REF_NAME --generate-notes --latest
fi
- name: Upload zip package to release
run: |
gh release upload $GITHUB_REF_NAME "tools/autograph-monitor/autograph-monitor.zip" --clobber
33 changes: 0 additions & 33 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,3 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .

monitor:
name: Build Monitor Lambda Zip
runs-on: ubuntu-22.04
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Build monitor
run: |
cd tools/autograph-monitor
make build
- name: Create release draft if a release doesn't exist yet
run: |
EXISTING_RELEASE=$(gh release view $GITHUB_REF_NAME --json="id" || echo '')
if [[ -z $EXISTING_RELEASE ]]; then
gh release create $GITHUB_REF_NAME --generate-notes -d
fi
- name: Upload zip package to release
run: |
gh release upload $GITHUB_REF_NAME "$RUNNER_TEMP/tools/autograph-monitor/autograph-monitor.zip" --clobber

0 comments on commit 3b78727

Please sign in to comment.