Add express-session package (#199) #625
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Build image | |
run: | | |
docker build . \ | |
--no-cache \ | |
--file docker/Dockerfile \ | |
--tag search-api | |
- name: Scan image | |
uses: aquasecurity/[email protected] | |
with: | |
image-ref: 'search-api' | |
severity: 'CRITICAL,HIGH' | |
format: 'sarif' | |
output: 'trivy.sarif' | |
- name: Upload scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v2 | |
if: always() | |
with: | |
sarif_file: 'trivy.sarif' | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image for development | |
run: | | |
IMAGE_ID=$(echo "ghcr.io/${{ github.repository }}" | tr '[A-Z]' '[a-z]') | |
GIT_SHORT_HASH=$(git rev-parse --short "$GITHUB_SHA") | |
DATE=$(date "+%Y%m%d%H%M%S") | |
VERSION="dev.$DATE.$GIT_SHORT_HASH.${{ github.run_number }}" | |
echo "VERSION=$VERSION" | |
docker tag search-api $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
- name: Push image for production | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
run: | | |
IMAGE_ID=$(echo "ghcr.io/${{ github.repository }}" | tr '[A-Z]' '[a-z]') | |
docker tag search-api $IMAGE_ID:$GITHUB_REF_NAME | |
docker push $IMAGE_ID:$GITHUB_REF_NAME | |
docker tag search-api $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest |