Skip to content

Commit

Permalink
misc CI improvements
Browse files Browse the repository at this point in the history
* move all gh action remote refs to tags with only major version numbers
* try to build the container image always (not pushed for non-main branches)
  • Loading branch information
finn-block committed Oct 18, 2023
1 parent ac78e39 commit 4bc67d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
name: Run Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18

Expand All @@ -34,3 +28,10 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

container-build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- run: docker build .
6 changes: 3 additions & 3 deletions .github/workflows/docker-image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Expand All @@ -50,7 +50,7 @@ jobs:
IMAGE_NAME: ${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
Expand Down

0 comments on commit 4bc67d0

Please sign in to comment.