Skip to content

Commit

Permalink
ci: Revert to using push event since workflow_runs is so convoluted
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Feb 21, 2024
1 parent 40da370 commit ac80c37
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/publishImage.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Publish Docker image to Dockerhub and GHCR
name: Publish Container Images

on:
push:
branches:
- 'main'
# add additional branches that should build to images here
# they will be tagged based on the branch name IE kener:test
- 'develop'
tags:
- '*.*.*'
Expand All @@ -25,13 +24,13 @@ jobs:
with:
node-version: '18.x'
cache: 'npm'
- name: Install dev dependencies
- name: Install dependencies
run: npm ci
- name: Test Backend
- name: Test
run: npm run test

push_to_registry:
name: Push Docker image to Docker Hub
name: Build and Push Container Images to Registries
runs-on: ubuntu-latest
needs: test
# only run if we've specified image tag to push to
Expand Down Expand Up @@ -59,7 +58,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
- name: Extract metadata (tags, labels) for Image
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -80,7 +79,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
- name: Build and push Images
uses: docker/build-push-action@v5
with:
context: .
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Publish Docker image to Dockerhub
name: Test

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- 'main'
- 'develop'
tags:
- '*.*.*'
# don't trigger if just updating docs
paths-ignore:
- 'README.md'

jobs:
test:
Expand All @@ -16,9 +23,7 @@ jobs:
with:
node-version: '18.x'
cache: 'npm'
- name: Install dev dependencies
- name: Install dependencies
run: npm ci
- name: Build Backend
run: 'npm run build:backend'
- name: Test Backend
- name: Test
run: npm run test
22 changes: 22 additions & 0 deletions .github/workflows/testPr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test PR

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test

0 comments on commit ac80c37

Please sign in to comment.