Skip to content

⬆️ improvement: correct encoder #36

⬆️ improvement: correct encoder

⬆️ improvement: correct encoder #36

Workflow file for this run

name: Build and publish container image
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- 'main'
jobs:
build:
name: Build and publish container images
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
m1212e/oidc-push
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.event.release.tag_name }}
SHA=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# name: Build and publish container image
# # TODO incorporate the whole lemontree security stuff here?
# on:
# push:
# branches:
# - 'main'
# pull_request:
# branches:
# - 'main'
# jobs:
# build:
# name: Build and publish container images
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# cache: 'npm'
# - name: Cache npm dependencies
# uses: actions/cache@v4
# with:
# path: |
# .npm
# node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
# - name: Create .npmrc from Secret
# run: echo "${{ secrets.NPMRC }}" > .npmrc
# - name: Install npm dependencies
# # TODO remove --legacy-peer-deps when drizzle reaches 1.0
# run: npm ci --cache .npm --prefer-offline --legacy-peer-deps
# - name: Remove .npmrc
# run: rm .npmrc
# - name: Run Trivy scanner on fs
# uses: aquasecurity/[email protected]
# with:
# scan-type: 'fs'
# scan-ref: '.'
# exit-code: 1
# format: 'table'
# ignore-unfixed: true
# vuln-type: 'os,library'
# severity: 'CRITICAL,HIGH'
# trivyignores: .trivyignore
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Login to GHCR
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# flavor: |
# latest=false
# images: |
# ghcr.io/${{ github.repository }}
# tags: |
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=raw,value={{branch}}-{{sha}}-{{date 'YYYYMMDDHHmmss'}},enable=${{ github.event_name != 'pull_request'}}
# - name: Build Docker image
# uses: docker/build-push-action@v5
# id: build
# with:
# load: true
# push: false
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# secrets: |
# npmrc=${{ secrets.NPMRC }}
# build-args: |
# VERSION=${{ github.event.release.tag_name }}
# SHA=${{ github.sha }}
# - name: Get first built image ref
# id: split-tags
# run: echo "fragment=$(echo "${DOCKER_METADATA_OUTPUT_TAGS}" | head -n 1)" >> $GITHUB_OUTPUT
# - name: Run Trivy vulnerability scanner on the built image
# uses: aquasecurity/[email protected]
# with:
# image-ref: ${{ steps.split-tags.outputs.fragment }}
# format: 'table'
# exit-code: '1'
# ignore-unfixed: true
# vuln-type: 'os,library'
# severity: 'CRITICAL,HIGH'
# skip-setup-trivy: true
# trivyignores: .trivyignore
# - name: Publish docker image
# uses: docker/build-push-action@v5
# with:
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# secrets: |
# npmrc=${{ secrets.NPMRC }}
# build-args: |
# VERSION=${{ github.event.release.tag_name }}
# SHA=${{ github.sha }}
# - name: Create GitHub Release
# uses: softprops/action-gh-release@v2
# if: github.ref_type == 'tag'
# with:
# generate_release_notes: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}