Skip to content

Pet Scripting, Attack Messages, and Attack Frequency #650

Pet Scripting, Attack Messages, and Attack Frequency

Pet Scripting, Attack Messages, and Attack Frequency #650

Workflow file for this run

---
name: Docker Image
"on":
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
package:
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
# actions/checkout v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Detect Go version
id: go-version
run: echo "version=$(make go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
# docker/setup-buildx-action v4.0.0
# yamllint disable-line rule:line-length
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Log in to the Container registry ${{ env.REGISTRY }}
# docker/login-action v4.1.0
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
# docker/metadata-action v6.0.0
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{
github.ref == 'refs/heads/master'
}}
type=ref,event=pr
type=sha
- name: Build and push Docker image
id: push
# docker/build-push-action v7.1.0
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
file: ./provisioning/Dockerfile
build-args: |
GO_VERSION=${{ steps.go-version.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=docker-package
cache-to: type=gha,mode=max,scope=docker-package
- name: Generate artifact attestation
if: github.event_name != 'pull_request'
# actions/attest-build-provenance v4.1.0
# yamllint disable-line rule:line-length
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: false