From 3b78727a48bb034ae4d2afd2d58e35e80a2c8175 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:32:54 -0600 Subject: [PATCH] AUT-250 - Missed that the deploy step also ran on merges to main. Moving 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 --- .github/workflows/build-monitor.yaml | 40 ++++++++++++++++++++++++++++ .github/workflows/deploy.yaml | 33 ----------------------- 2 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build-monitor.yaml diff --git a/.github/workflows/build-monitor.yaml b/.github/workflows/build-monitor.yaml new file mode 100644 index 000000000..7583138e6 --- /dev/null +++ b/.github/workflows/build-monitor.yaml @@ -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 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c51403fd6..2d5567a46 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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