Skip to content

v0.7.2

v0.7.2 #24

Workflow file for this run

name: production image build
on:
release:
types:
- published
jobs:
build_new_image:
name: build new image on release
runs-on: ubuntu-latest
steps:
- name: checkout service
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
repository: invenlore/api.gateway
ref: ${{ github.event.release.tag_name }}
- name: login to docker hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: setup docker buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: setup go build cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: go-build-cache
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
- name: inject go-build-cache
uses: reproducible-containers/buildkit-cache-dance@a7e6c84254deea63f27ad452032d8fdd4815301a # v2
with:
cache-source: go-build-cache
- name: cve scan builder base (docker scout)
uses: docker/scout-action@f8c776824083494ab0d56b8105ba2ca85c86e4de # v1
continue-on-error: true
with:
command: cves
image: golang:1.24.12
platform: linux/amd64
only-severities: high,critical
summary: true
- name: build image for cve scan
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: .
file: ./Dockerfile
load: true
tags: invenlore/invenlore-api-gateway:cve-scan
cache-from: type=gha
cache-to: type=gha,mode=max
- name: cve scan (docker scout)
uses: docker/scout-action@f8c776824083494ab0d56b8105ba2ca85c86e4de # v1
with:
command: cves
image: invenlore/invenlore-api-gateway:cve-scan
only-severities: high,critical
exit-code: 1
summary: true
- name: build and push
id: push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: .
file: ./Dockerfile
push: true
build-args: |
SERVICE_VERSION=${{ github.event.release.tag_name }}
labels: |
org.opencontainers.image.version=${{ github.event.release.tag_name }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
invenlore/invenlore-api-gateway:master
invenlore/invenlore-api-gateway:${{ github.event.release.tag_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: dokploy update image
uses: jegork/dokploy-update-image-action@582d95db06f6581cb2af7739d977afff97c3c971 # 0.1.0
with:
token: ${{ secrets.DOKPLOY_AUTH_TOKEN }}
application_id: ${{ secrets.DOKPLOY_APPLICATION_ID }}
image: invenlore/invenlore-api-gateway:${{ github.event.release.tag_name }}
base_url: ${{ secrets.DOKPLOY_URL }}
- name: dokploy deployment
run: |
curl -X 'POST' \
"${{ secrets.DOKPLOY_URL }}/api/application.deploy" \
-H 'accept: application/json' \
-H "x-api-key: ${{ secrets.DOKPLOY_AUTH_TOKEN }}" \
-H 'Content-Type: application/json' \
-d '{"applicationId": "${{ secrets.DOKPLOY_APPLICATION_ID }}"}'