Skip to content

Commit

Permalink
ci(github): add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Dec 13, 2023
1 parent fb2154e commit 92f8b89
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#

name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: package.json
- run: npm ci
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#

name: Publish

on:
push:
branches:
- master
workflow_dispatch:

permissions:
packages: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/betagouv/moncomptepro-test-client
tags: |
type=sha,format=long,prefix=
type=ref,event=branch
type=ref,event=tag
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
- name: Build image
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
build-args: |
SOURCE_COMMIT=${{ github.sha }}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
"type": "module",
"devDependencies": {
"prettier": "^3.0.3"
},
"engines": {
"node": "20",
"npm": ">=9"
}
}

0 comments on commit 92f8b89

Please sign in to comment.