Skip to content

Commit

Permalink
Add separate staging and production workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Jan 27, 2023
1 parent 113ceb9 commit 4328d6c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/main.yml → .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Release
name: Deploy to production

on:
push:
branches:
- master
release:
types: [published]

jobs:
test:
uses: ./.github/workflows/test.yml

dockerhub-release:
runs-on: ubuntu-latest
steps:
Expand All @@ -21,11 +23,10 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: toska/kliksutin:staging
tags: toska/kliksutin:production
build-args: |
BASE_PATH=/
GIT_SHA=${{ github.sha }}
STAGING=true
sentry-release:
runs-on: ubuntu-latest
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to staging

on: push

jobs:
test:
uses: ./.github/workflows/test.yml

dockerhub-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: toska/kliksutin:staging
build-args: |
BASE_PATH=/
GIT_SHA=${{ github.sha }}
STAGING=true
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name: E2E Tests

on: push
on: [workflow_call]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build project for eslint
run: npm install
- name: Run eslint
run: npm run lint

cypress:
runs-on: ubuntu-latest
steps:
Expand All @@ -22,12 +31,3 @@ jobs:
if: failure()
with:
path: /home/runner/work/kliksutin/kliksutin/cypress/videos/*

eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build project for eslint
run: npm install
- name: Run eslint
run: npm run lint

0 comments on commit 4328d6c

Please sign in to comment.