Skip to content

Commit

Permalink
ny workflow (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonph authored Oct 29, 2021
1 parent 1691015 commit ca21891
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 108 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/alerts-dev.yml

This file was deleted.

25 changes: 23 additions & 2 deletions .github/workflows/alerts-prod.yml → .github/workflows/alerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ on:
paths:
- 'alerts-prod.yaml'
- 'alerts-prod-arena.yaml'
- '.github/workflows/alerts-prod.yaml'
- 'alerts-dev.yaml'
- 'alerts-dev-arena.yaml'
- '.github/workflows/alerts.yaml'

concurrency:
group: deploy_alerts_prod
cancel-in-progress: true

jobs:
apply-alerts:
apply-alerts-dev:
name: Apply alerts to dev
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: deploy to dev
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: alerts-dev.yaml
- name: deploy arena alert
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: alerts-dev-arena.yaml

apply-alerts-prod:
name: Apply alerts to prod
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 34 additions & 2 deletions .github/workflows/prod.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Prod
on:
push:
workflow_dispatch:
branches:
- master
- main

concurrency:
group: deploy_prod
Expand Down Expand Up @@ -39,9 +40,39 @@ jobs:
docker build -t ${IMAGE}:${IMAGE_TAG} .
docker push ${IMAGE}:${IMAGE_TAG}
deploy-dev:
name: Deploy application to Q1
needs: test-build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Deploy application
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: nais-q.yaml
VAR: version=${{ env.IMAGE_TAG }},namespace=q1

release-dev:
name: Create dev release
needs: deploy-dev
runs-on: ubuntu-latest
steps:
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release/dev@${{ env.IMAGE_TAG }}
release_name: Release to dev
prerelease: true

deploy-prod:
name: Deploy application to prod
needs: test-build-and-push
needs: deploy-dev
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -57,6 +88,7 @@ jobs:
release-prod:
name: Create prod release
needs: deploy-prod
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Create release
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/dev.yml

This file was deleted.

0 comments on commit ca21891

Please sign in to comment.