Merge pull request #68 from DazWilkin/dependabot/go_modules/google.go… #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ackal: | |
name: consul-sd-cloudrun | |
runs-on: ubuntu-latest | |
env: | |
IMAGE: dazwilkin/consul-sd-cloudrun | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup | |
uses: docker/setup-buildx-action@v3 | |
- name: login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR }} | |
- name: Get kernel version | |
run: echo "VERSION=$(uname --kernel-release)" >> ${GITHUB_ENV} | |
- name: discoverer | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
build-args: | | |
TOKEN=${{ secrets.GHCR }} | |
VERSION=${{ env.VERSION }} | |
COMMIT=${{ github.sha }} | |
tags: ghcr.io/${{ env.IMAGE }}:${{ github.sha }} | |
push: true | |
- name: revise occurrences of the image | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
for FILENAME in "./README.md" "./docker-compose.yml" | |
do | |
echo "Replacing: ${IMAGE}" | |
sed \ | |
--in-place \ | |
"s|${IMAGE}:[0-9a-f]\{40\}|${IMAGE}:${{ github.sha }}|g" \ | |
${FILENAME} | |
git add ${FILENAME} | |
done | |
git commit --message "GitHub Actions update image references" | |
git push origin main |