Skip to content

Commit

Permalink
TRACK-357: split deploy action into seperate test/prod (#2501)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ckoelewyn authored Jan 16, 2025
1 parent e2ec287 commit 7b2be8a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy-to-Prod

defaults:
run:
shell: bash
working-directory: ./

jobs:
deployment:
runs-on: ubuntu-20.04
environment:
name: prod
steps:
- uses: actions/checkout@v2

- name: Set Timestamp
id: timestamp
run: echo "::set-output name=ts::$(date +'%Y-%m-%d_%H-%M-%S')"

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OPENSHIFT_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT_SA_TOKEN}}
- name: Backup Current Prod
shell: bash
run: |
oc project ${{ secrets.OPENSHIFT_REPOSITORY }}-tools
TIMESTAMP=${{ steps.timestamp.outputs.ts }}
oc tag epictrack-api:prod epictrack-api:prod-backup-${TIMESTAMP}
oc tag epictrack-web:prod epictrack-web:prod-backup-${TIMESTAMP}
- name: Tag Images and Rollout
shell: bash
run: |
oc project ${{ secrets.OPENSHIFT_REPOSITORY }}-tools
oc tag epictrack-api:test epictrack-api:prod
oc tag epictrack-web:test epictrack-web:prod
oc rollout status dc/epictrack-api -n ${{ secrets.OPENSHIFT_REPOSITORY }}-prod -w
oc rollout status dc/epictrack-web -n ${{ secrets.OPENSHIFT_REPOSITORY }}-prod -w
29 changes: 29 additions & 0 deletions .github/workflows/deploy-to-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy-to-Test

defaults:
run:
shell: bash
working-directory: ./

jobs:
deployment:
runs-on: ubuntu-20.04
environment:
name: test
steps:
- uses: actions/checkout@v2

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OPENSHIFT_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT_SA_TOKEN}}
- name: Tag Images and Rollout
shell: bash
run: |
oc project ${{ secrets.OPENSHIFT_REPOSITORY }}-tools
oc tag epictrack-api:latest epictrack-api:test
oc tag epictrack-web:latest epictrack-web:test
oc rollout status dc/epictrack-api -n ${{ secrets.OPENSHIFT_REPOSITORY }}-test -w
oc rollout status dc/epictrack-web -n ${{ secrets.OPENSHIFT_REPOSITORY }}-test -w

0 comments on commit 7b2be8a

Please sign in to comment.