Skip to content

Commit

Permalink
Merge pull request #55 from SAKPaaS/feature/github-actions
Browse files Browse the repository at this point in the history
GitHub-Actions
  • Loading branch information
r-franzke authored Mar 26, 2020
2 parents 04c1b99 + a84a96c commit f1c0616
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 22 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Development

on:
pull_request:
types: [closed]

jobs:
build:
name: Build+Push image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Login to registry
if: success()
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Build image
if: success()
run: docker build -t sakpaas/backend:dev-${GITHUB_SHA} .

- name: Push <image>:development
if: success()
uses: actions-hub/docker@master
with:
args: push sakpaas/backend:dev-${GITHUB_SHA}


deploy:
name: Deployment
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'SAKPaaS/deployment'

- name: Kustomize
uses: stefanprodan/kube-tools@v1
with:
kustomize: 3.4.0
command: "cd backend/development && kustomize edit set image sakpaas/backend=sakpaas/backend:dev-${GITHUB_SHA}"

- name: Deploy
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -k backend/development
22 changes: 0 additions & 22 deletions .github/workflows/dockerimage.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Linter

# Trigger on push
on: push

jobs:
lint:
name: Run Linter
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Echo
run: echo "Here a linter should be invoked"
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release

on:
release:
types: [created]

jobs:
build:
name: Build+Push image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Login to registry
if: success()
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Build image
if: success()
run: docker build -t sakpaas/backend:release-${GITHUB_REF} .

- name: Tag image
if: success()
run: docker tag sakpaas/backend:release-${GITHUB_REF} sakpaas/backend:latest

- name: Push <image>:release-<tag>
if: success()
uses: actions-hub/docker@master
with:
args: push sakpaas/backend:${GITHUB_REF}

- name: Push <image>:latest
if: success()
uses: actions-hub/docker@master
with:
args: push sakpaas/backend:release-${GITHUB_REF}


deploy:
name: Deployment
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'SAKPaaS/deployment'

- name: Kustomize
uses: stefanprodan/kube-tools@v1
with:
kustomize: 3.4.0
command: "cd backend/production && kustomize edit set image sakpaas/backend=sakpaas/backend:release-${GITHUB_REF}"

- name: Deploy
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -k backend/production

0 comments on commit f1c0616

Please sign in to comment.