Skip to content

v1.4.0

v1.4.0 #10

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
init:
name: 🚩 Initialize
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
docker:
name: 🐳 Build Docker image
runs-on: ubuntu-22.04
needs: init
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Get repository info
uses: gacts/github-slug@v1
id: slug
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Build & Push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7
build-args: |
APP_VERSION=${{ steps.slug.outputs.version }}"
DATE_CREATED=${{ steps.date.outputs.date }}
tags: |
hatamiarash7/asn-by-country:${{ steps.slug.outputs.version }}
hatamiarash7/asn-by-country:latest
ghcr.io/${{ github.actor }}/asn-by-country:${{ steps.slug.outputs.version }}
ghcr.io/${{ github.actor }}/asn-by-country:latest
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: hatamiarash7/asn-by-country:latest
exit-code: "0"
ignore-unfixed: true
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"