Skip to content

Commit

Permalink
Revert "ci: Streamline test -> image publish workflows"
Browse files Browse the repository at this point in the history
This reverts commit be1d6a7.
  • Loading branch information
FoxxMD committed Feb 21, 2024
1 parent 8eb0112 commit 40da370
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 40 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/publishImage.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
name: Publish Container Images
name: Publish Docker image to Dockerhub and GHCR

on:
workflow_run:
workflows:
- Test
types:
- completed
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'
push:
tags:
- '*.*.*'
# don't trigger if just updating docs
paths-ignore:
- 'README.md'

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 dev dependencies
run: npm ci
- name: Test Backend
run: npm run test

push_to_registry:
name: Build and Push Images to Registries
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
# only run if we've specified image tag to push to
if: ${{ (github.event_name === 'push' || github.event.workflow_run.conclusion == 'success') && (vars.DOCKERHUB_IMAGE_NAME != '' || vars.GHCR_IMAGE_NAME != '') }}
if: ${{ vars.DOCKERHUB_IMAGE_NAME != '' || vars.GHCR_IMAGE_NAME != '' }}
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions:
packages: write
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Test
name: Publish Docker image to Dockerhub

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

jobs:
test:
Expand All @@ -23,5 +18,7 @@ jobs:
cache: 'npm'
- name: Install dev dependencies
run: npm ci
- name: Test
- name: Build Backend
run: 'npm run build:backend'
- name: Test Backend
run: npm run test
22 changes: 0 additions & 22 deletions .github/workflows/testPr.yml

This file was deleted.

0 comments on commit 40da370

Please sign in to comment.