Skip to content

build-druid

build-druid #366

Workflow file for this run

name: build-druid
on:
schedule:
- cron: '0 0 */14 * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
tag: [36.0.0, 35.0.1, 31.0.0, 30.0.1, 28.0.1]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: '1.25'
- name: Generate LGTM App token
id: lgtm-app-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3
with:
permission-contents: write
client-id: ${{ secrets.LGTM_APP_CLIENT_ID }}
private-key: ${{ secrets.LGTM_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Prepare git
env:
LGTM_APP_TOKEN: ${{ steps.lgtm-app-token.outputs.token }}
run: |
set -x
git config --global user.name "1gtm-app[bot]"
git config --global user.email "3686661+1gtm-app[bot]@users.noreply.github.com"
git config --global \
url."https://x-access-token:${LGTM_APP_TOKEN}@github.com".insteadOf \
"https://github.com"
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
cache-image: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
with:
platforms: linux/amd64,linux/arm64
- uses: imjasonh/setup-crane@5146f708a817ea23476677995bf2133943b9be0b # v0.1
- name: Install trivy
run: |
# wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
# sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
sudo apt-get install -y --no-install-recommends wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb generic main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sleep 5
sudo apt-get install -y --no-install-recommends trivy
- name: Log in to the GitHub Container registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Build
run: |
go run cmd/build-image/main.go --name=druid --tag=${{ matrix.tag }}
# report:
# name: Report
# runs-on: ubuntu-latest
# needs: build
# if: always()
# steps:
# - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
#
# - name: Set up Go
# uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
# with:
# go-version: '1.25'
#
# - name: Prepare git
# env:
# GITHUB_USER: ${{ github.actor }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# set -x
# git config --global user.name "${GITHUB_USER}"
# git config --global user.email "${GITHUB_USER}@appscode.com"
# git config --global \
# url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
# "https://github.com"
# # git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
#
# - name: Set up QEMU
# id: qemu
# uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
# with:
# cache-image: false
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
# with:
# platforms: linux/amd64,linux/arm64
#
# - name: Log in to the GitHub Container registry
# uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Install trivy
# run: |
# # wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
# # sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
# sudo apt-get install -y --no-install-recommends wget apt-transport-https gnupg lsb-release
# wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
# echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends trivy
#
# - name: Build
# env:
# SMTP_ADDRESS: ${{ secrets.SMTP_ADDRESS }}
# SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
# SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
# run: |
# go run cmd/mail-report/main.go --name=druid
#
# - name: Update repo
# run: |
# git add --all
# if [[ $(git status --porcelain) ]]; then
# git commit -s -a -m "update druid images $(date --rfc-3339=date)"
# git fetch origin
# # https://git-scm.com/docs/merge-strategies
# git pull --rebase -s ours origin master
# git push origin HEAD
# fi