Skip to content

Commit

Permalink
chore(all): added one more try
Browse files Browse the repository at this point in the history
  • Loading branch information
dsebastien committed Oct 11, 2024
1 parent dd8aa8c commit e9e7449
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history for all tags and branches
fetch-depth: 0

# Create and merge a PR for this deployment
# This is a workaround for the production branch protection
# Reference: https://github.com/krlmlr/pr-bots/blob/main/.github/workflows/write-file-branch-merge.yaml
# Merge main into the production branch to synchronize production, and trigger the deployment
- run: |
gh pr create --title "Deploy ${GITHUB_SHA}" --body "This is a Deployment PR" --repo knowii-oss/knowii --base production --head main
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
gh pr merge $pr_number --rebase
shell: bash
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
gh pr create --title "Deploy ${GITHUB_SHA}" --body "This is a Deployment PR" --base production --head main
git switch main
git pull
git switch production
git rebase origin/main
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NX_NO_CLOUD: true
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"commit": "cz",
"commit:lint": "commitlint --env HUSKY_GIT_PARAMS",
"db:admin": "docker run -it --rm -p 5050:5050 --name=pgadmin4 --link=knowii-pgsql-1 --network=knowii_sail --env PGADMIN_LISTEN_ADDRESS=0.0.0.0 --env PGADMIN_LISTEN_PORT=5050 --env PGADMIN_DISABLE_POSTFIX=true --env [email protected] --env PGADMIN_DEFAULT_PASSWORD=password dpage/pgadmin4",
"deploy": "git checkout main && git pull && git switch production && git rebase origin/main && git push && git checkout main",
"dev": "npx nx run knowii:serve",
"format": "npx nx format --all",
"format:all": "npm run format",
Expand Down

0 comments on commit e9e7449

Please sign in to comment.