Skip to content

Merge pull request #80 from DazWilkin/dependabot/go_modules/github.co… #77

Merge pull request #80 from DazWilkin/dependabot/go_modules/github.co…

Merge pull request #80 from DazWilkin/dependabot/go_modules/github.co… #77

Workflow file for this run

name: build
on:
push:
branches:
- master
jobs:
linode-exporter:
name: linode-exporter
runs-on: ubuntu-latest
env:
REPO: dazwilkin/linode-exporter
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup
uses: docker/setup-buildx-action@v3
- name: QEMU
uses: docker/setup-qemu-action@v3
- name: login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR }}
- name: get-version
run: echo "VERSION=$(uname --kernel-release)" >> ${GITHUB_ENV}
- name: Buildx Multi-platform Linux Docker Images
id: docker-build-push-multi-platform
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v7,linux/arm64
file: ./Dockerfile
build-args: |
VERSION=${{ env.VERSION }}
COMMIT=${{ github.sha }}
tags: ghcr.io/${{ env.REPO }}:${{ github.sha }}
push: true
- name: install-cosign
uses: sigstore/cosign-installer@main
- name: write-key
run: echo "${{ secrets.SIGNING }}" > ./cosign.key
- name: sign-image
run: |
DIGEST=${{ steps.docker-build-push-multi-platform.outputs.digest }}
cosign sign \
--yes \
--key=./cosign.key \
--annotations="repo=${{ github.repository }}" \
--annotations="workflow=${{ github.workflow }}" \
--annotations="commit=${{ github.sha }}" \
--annotations="version=${{ env.VERSION }}" \
ghcr.io/${{ env.REPO }}@${DIGEST}
env:
COSIGN_PASSWORD: ""
- name: revise-docs
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
for FILENAME in "./docker-compose.yaml" "./README.md"
do
sed \
--in-place \
"s|ghcr.io/${{ env.REPO }}:[0-9a-f]\{40\}|ghcr.io/${{ env.REPO }}:${{ github.sha }}|g" \
${FILENAME}
git add ${FILENAME}
done
git commit --message "GitHub Actions update image references"
git push origin master