Skip to content

fix: no-cache the SPA shell so deploys aren't masked by a stale brows… #86

fix: no-cache the SPA shell so deploys aren't masked by a stale brows…

fix: no-cache the SPA shell so deploys aren't masked by a stale brows… #86

Workflow file for this run

name: Docker
on:
push:
tags: ["v*"]
pull_request:
branches: [main]
permissions:
contents: read
id-token: write
env:
IMAGE_NAME: stephenjr002/sairo
jobs:
security-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so gitleaks can resolve the PR commit range
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.0.0
with:
dockerfile: Dockerfile
- name: Secret scanning
uses: gitleaks/gitleaks-action@v2.3.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
needs: security-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=sha-
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: true
sbom: true
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
- name: Sign image
if: github.event_name != 'pull_request'
run: cosign sign --yes ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}