Skip to content

Commit

Permalink
feat: split workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylar Simoncelli committed Oct 23, 2024
1 parent 7c3a132 commit 9f3cb2e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 38 deletions.
55 changes: 17 additions & 38 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,49 +379,28 @@ jobs:
markers: "not active_flow and not passive_flow"
deployment_mc_epoch: $DEPLOYMENT_MC_EPOCH

# build-and-publish-ghcr:
# permissions:
# id-token: write
# contents: write
# packages: write
# needs: staging-preview-tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build and Publish to GHCR
# if: ${{ github.event.inputs.no-release == 'false' }}
# uses: ./.github/actions/images/build-and-publish-ghcr
# with:
# sha: ${{ inputs.sha }}
# tag: ${{ inputs.tag }}
# env:
# GITHUB_ACTOR: ${{ github.actor }}
# GITHUB_TOKEN: ${{ github.token }}
#
# publish-release:
# permissions:
# id-token: write
# contents: write
# packages: write
# needs: staging-preview-tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Publish Release
# if: ${{ github.event.inputs.no-release == 'false' }}
# uses: ./.github/actions/release/publish-draft-release
# with:
# tag: ${{ inputs.tag }}
# env:
# GITHUB_TOKEN: ${{ github.token }}
publish:
permissions:
id-token: write
contents: write
packages: write
needs: run-all-tests-on-n2-epoch
runs-on: ubuntu-latest
steps:
- name: Trigger Publish Workflow
if: ${{ github.event.inputs.no-release == 'false' }}
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.ACTIONS_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/<owner>/<repo>/actions/workflows/publish.yml/dispatches \
-d '{"ref": "main", "inputs": {"sha": "${{ github.sha }}", "tag": "${{ github.ref }}"}}'
#
# deploy-staging-preprod:
# permissions:
# id-token: write
# contents: write
# needs: staging-preview-tests
# needs: run-all-tests-on-n2-epoch
# runs-on: eks
# steps:
# - name: Checkout
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish the draft release created by cd.yml, and upload GHCR image

on:
workflow_dispatch:
inputs:
sha:
description: 'The SHA of the commit to build'
required: true
type: string
tag:
description: 'The tag for the release'
required: true
type: string

jobs:
build-and-publish-ghcr:
permissions:
id-token: write
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Publish to GHCR
uses: ./.github/actions/images/build-and-publish-ghcr
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}

publish-release:
permissions:
id-token: write
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish Release
uses: ./.github/actions/release/publish-draft-release
with:
tag: ${{ inputs.tag }}
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 9f3cb2e

Please sign in to comment.