Skip to content

Commit

Permalink
chore: new workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MilGard91 committed Nov 15, 2024
1 parent d69e053 commit b686828
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ff-release-candidate-to-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Fast-forward dev to master

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
fast-forward:
uses: NexusMutual/workflows/.github/workflows/w-fast-forward.yml
with:
environment: production
source-ref: release-candidate
target-ref: master
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

tag-image:
uses: NexusMutual/workflows/.github/workflows/w-tag-image.yml
needs: fast-forward
with:
environment: production
image: ${{ github.repository }}
ref: master
target-tag: latest
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
60 changes: 60 additions & 0 deletions .github/workflows/merge-to-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Merge to dev

on:
pull_request:
types:
- closed
branches:
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
reset-release-candidate:
if: github.event.pull_request.merged == true
uses: NexusMutual/workflows/.github/workflows/w-reset.yml
with:
target-ref: release-candidate
base-ref: dev
environment: production
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

bump:
needs: reset-release-candidate
uses: NexusMutual/workflows/.github/workflows/w-bump.yml
with:
ref: 'release-candidate'
bump-command: npm version patch --no-git-tag-version
environment: production
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

build:
needs: bump
uses: NexusMutual/workflows/.github/workflows/w-build.yml
with:
ref: 'release-candidate'
environment: production
image: ${{ github.repository }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

tag-image:
needs: build
uses: NexusMutual/workflows/.github/workflows/w-tag-image.yml
with:
environment: production
image: ${{ github.repository }}
ref: 'release-candidate'
target-tag: ${{ github.ref_name == 'master' && 'latest' || 'staging' }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
96 changes: 96 additions & 0 deletions .github/workflows/merge-to-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Merge to master

on:
pull_request:
types:
- closed
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
bump:
if: github.event.pull_request.merged == true
uses: NexusMutual/workflows/.github/workflows/w-bump.yml
with:
ref: 'master'
bump-command: npm version patch --no-git-tag-version
environment: production
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

build:
needs: bump
uses: NexusMutual/workflows/.github/workflows/w-build.yml
with:
ref: 'master'
environment: production
image: ${{ github.repository }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

tag-image:
needs: build
uses: NexusMutual/workflows/.github/workflows/w-tag-image.yml
with:
environment: production
image: ${{ github.repository }}
ref: 'master'
target-tag: ${{ github.ref_name == 'master' && 'latest' || 'staging' }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

rebase-dev:
needs: build
uses: NexusMutual/workflows/.github/workflows/w-rebase.yml
with:
target-ref: dev
base-ref: master
environment: production
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

reset-release-candidate:
needs: rebase-dev
uses: NexusMutual/workflows/.github/workflows/w-reset.yml
with:
target-ref: release-candidate
base-ref: dev
environment: production
secrets:
DEPLOYER_APP_ID: ${{ secrets.DEPLOYER_APP_ID }}
DEPLOYER_APP_PK: ${{ secrets.DEPLOYER_APP_PK }}

rebuild-staging:
needs: reset-release-candidate
uses: NexusMutual/workflows/.github/workflows/w-build.yml
with:
ref: release-candidate
environment: production
image: ${{ github.repository }}
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

retag-staging:
needs: rebuild-staging
uses: NexusMutual/workflows/.github/workflows/w-tag-image.yml
with:
environment: production
image: ${{ github.repository }}
ref: release-candidate
target-tag: staging
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit b686828

Please sign in to comment.