Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lukatarman/steam-game-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
twoGiants committed Nov 9, 2023
2 parents 2887eb2 + 3b29542 commit 3d9ef2e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 19 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate, build and push backend.
name: Validate backend.

on:
push:
Expand Down Expand Up @@ -31,21 +31,3 @@ jobs:
run: npm run -w backend unit-test
- name: Integration tests
run: npm run -w backend integration-test

build-and-push:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
file: backend/Dockerfile
tags: sjakusch/steam-game-stats-backend:latest
59 changes: 59 additions & 0 deletions .github/workflows/cicd-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Validate and deploy backend.

on:
push:
branches: [master]
paths: ["backend/**"]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.12.1]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install backend dependencies
run: npm ci -w backend
- name: Prettier check
run: npm run -w backend prettier:check
- name: Unit tests
run: npm run -w backend unit-test
- name: Integration tests
run: npm run -w backend integration-test

build-and-push:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
file: backend/Dockerfile
tags: sjakusch/steam-game-stats-backend:latest

deploy:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Deploy on Render
if: github.ref == 'refs/heads/master'
env:
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
run: |
curl "$deploy_url"

0 comments on commit 3d9ef2e

Please sign in to comment.