Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/deploy-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Production
on:
workflow_dispatch:
inputs:
confirm_deploy:
description: 'Type "deploy" to confirm'
required: true
default: ''

jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.inputs.confirm_deploy == 'deploy'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Rebase prod to master and deploy
run: |
git config user.name "NedaaBot"
git config user.email "186649556+NedaaBot@users.noreply.github.com"
git switch master
git pull origin master
git switch prod
git rebase master
git push --force-with-lease origin prod
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: Deploy Docker Image

name: Build and Deploy
on:
push:
branches:
- '**'

- 'prod'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
Expand All @@ -17,7 +14,6 @@ jobs:
packages: write
attestations: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -44,6 +40,10 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.ref == 'refs/heads/master' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Trigger Deployment Update
run: |
curl -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" ${{ secrets.DEPLOY_ENDPOINT }}