Skip to content

feat(): add license (#19) #8

feat(): add license (#19)

feat(): add license (#19) #8

Workflow file for this run

name: Docker
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
- '!.github/workflows/docker.yml'
workflow_dispatch:
jobs:
docker-action:
name: Docker Action container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Get Date Tag
run: echo "TIMESTAMP_TAG=$(date '+%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build for development
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
if:
with:
context: .
load: true
platforms: linux/amd64
no-cache: true
pull: true
target: production
tags: "ghcr.io/${{ github.repository }}/github-to-slack-notifier:${{ env.TIMESTAMP_TAG }}"
push: true
- name: Run Trivy to check Docker images for vulnerabilities
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
with:
image-ref: "ghcr.io/${{ github.repository }}/github-to-slack-notifier:${{ env.TIMESTAMP_TAG }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Build for production
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
if: github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch'
with:
context: .
load: true
platforms: linux/amd64
no-cache: true
pull: true
target: production
tags: "ghcr.io/${{ github.repository }}/github-to-slack-notifier:latest"