forked from pepite/lunatech-blog-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds automation for deploying acceptance and production (#123)
* Adds automation for deploying acceptance and production * Adds README docs * Removes restart requirement
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Deploy Acceptance | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
deploy_acceptance: | ||
uses: ./.github/workflows/deploy_template.yaml | ||
with: | ||
target_branch: 'acceptance' | ||
source_branch: 'main' | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Deploy Production | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
deploy_acceptance: | ||
uses: ./.github/workflows/deploy_template.yaml | ||
with: | ||
target_branch: 'production' | ||
source_branch: 'acceptance' | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Deploy Template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
source_branch: | ||
type: string | ||
required: true | ||
description: Source Branch | ||
target_branch: | ||
type: string | ||
required: true | ||
description: Target Branch | ||
jobs: | ||
deploy: | ||
name: Deploy ${{ inputs.target_branch }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
name: Generate GitHub Token | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.LUNATECH_BLOG_APP_ID }} | ||
private-key: ${{ secrets.LUNATECH_BLOG_APP_PRIVATE_KEY }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
fetch-depth: '0' | ||
|
||
- name: Merge from ${{ inputs.source_branch }} to ${{ inputs.target_branch }} | ||
run: | | ||
git fetch origin | ||
git checkout ${{ inputs.target_branch }} | ||
git rebase origin/${{ inputs.source_branch }} | ||
git push origin ${{ inputs.target_branch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters