Skip to content

Commit

Permalink
Add PR Check
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitmouton committed Feb 24, 2023
1 parent 2159b0c commit ee68635
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: CI
name: build

on:
push:
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/tag-prod-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
name: Tag production image

on:
push:
tags:
- '*'
push:
tags:
- "*"

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

build:
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Docker Login
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
build:
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Docker Login
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: pull current image
run: |
docker pull ghcr.io/${{ github.repository }}:$GITHUB_SHA
- name: pull current image
run: |
docker pull ghcr.io/${{ github.repository }}:$GITHUB_SHA
- name: push tagged image
run: |
docker tag ghcr.io/${{ github.repository }}:$GITHUB_SHA ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME
docker tag ghcr.io/${{ github.repository }}:$GITHUB_SHA ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME
docker push ghcr.io/${{ github.repository }}:latest
- name: push tagged image
run: |
docker tag ghcr.io/${{ github.repository }}:$GITHUB_SHA ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME
docker tag ghcr.io/${{ github.repository }}:$GITHUB_SHA ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME
docker push ghcr.io/${{ github.repository }}:latest
79 changes: 79 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
setup:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19
cache: npm

- name: Install Dependencies
run: npm ci

build:
runs-on: ubuntu-latest
needs: ['setup']

steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19
cache: npm

- name: Install Dependencies
run: npm ci

- name: build
run: npm run build

- uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-build_output
path: dist
retention-days: 1

codeQL:
runs-on: ubuntu-latest
needs: ['build']

permissions:
security-events: write
actions: read
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript

- name: Install Dependencies
run: npm ci

- uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-build_output

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

0 comments on commit ee68635

Please sign in to comment.