pin GHA versions. readme and workflow tweaks (#15)

This commit is contained in:
Bret Fisher
2023-03-08 10:00:26 -05:00
committed by GitHub
parent db3d102d89
commit 75d2a00064
4 changed files with 27 additions and 14 deletions

View File

@@ -17,6 +17,18 @@ on:
- '.github/linters/**' - '.github/linters/**'
jobs: jobs:
testing-event-messages:
if: always()
runs-on: ubuntu-latest
steps:
-
run: |
echo "event_name: ${{ github.event_name }}"
# echo "event.workflow_run: ${{ github.event.workflow_run }}"
echo "event.head_commit: ${{ github.event.head_commit }}"
echo "event.head_commit.message: ${{ github.event.head_commit.message }}"
call-docker-build: call-docker-build:
name: Call Docker Build name: Call Docker Build

View File

@@ -22,7 +22,7 @@ jobs:
### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows ### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
### you can also call workflows from inside the same repo via file path ### you can also call workflows from inside the same repo via file path
#FIXME: customize uri to point to your own linter repository #FIXME: customize uri to point to your own reusable linter repository
uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main
### Optional settings examples ### Optional settings examples

View File

@@ -109,28 +109,28 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3.3.0
- -
# we need qemu and buildx so we can build multiple platforms later # we need qemu and buildx so we can build multiple platforms later
name: Set up QEMU name: Set up QEMU
id: qemu id: qemu
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2.1.0
- -
# BuildKit (used with `docker buildx`) is the best way to build images # BuildKit (used with `docker buildx`) is the best way to build images
name: Set up Docker Buildx name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2.4.1
- -
name: Login to DockerHub name: Login to DockerHub
if: inputs.dockerhub-enable if: inputs.dockerhub-enable
uses: docker/login-action@v2 uses: docker/login-action@v2.1.0
with: with:
username: ${{ secrets.dockerhub-username }} username: ${{ secrets.dockerhub-username }}
password: ${{ secrets.dockerhub-token }} password: ${{ secrets.dockerhub-token }}
- -
name: Login to GHCR name: Login to GHCR
if: inputs.ghcr-enable if: inputs.ghcr-enable
uses: docker/login-action@v2 uses: docker/login-action@v2.1.0
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@@ -138,7 +138,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: docker_meta id: docker_meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4.3.0
with: with:
# list of Docker images to use as base name for tags # list of Docker images to use as base name for tags
images: ${{ inputs.image-names }} images: ${{ inputs.image-names }}
@@ -149,7 +149,7 @@ jobs:
# then push to one or more registries (based on image list above in docker_meta) # then push to one or more registries (based on image list above in docker_meta)
name: Docker Build and Push name: Docker Build and Push
id: build_image id: build_image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4.0.0
with: with:
platforms: ${{ inputs.platforms }} platforms: ${{ inputs.platforms }}
context: ${{ inputs.context }} context: ${{ inputs.context }}
@@ -167,7 +167,7 @@ jobs:
# If PR, put image tags in the PR comments # If PR, put image tags in the PR comments
# from https://github.com/marketplace/actions/create-or-update-comment # from https://github.com/marketplace/actions/create-or-update-comment
name: Find comment for image tags name: Find comment for image tags
uses: peter-evans/find-comment@v2 uses: peter-evans/find-comment@v2.2.1
if: github.event_name == 'pull_request' && inputs.comment-enable if: github.event_name == 'pull_request' && inputs.comment-enable
id: fc id: fc
with: with:
@@ -177,7 +177,7 @@ jobs:
# If PR, put image tags in the PR comments # If PR, put image tags in the PR comments
- name: Create or update comment for image tags - name: Create or update comment for image tags
uses: peter-evans/create-or-update-comment@v2 uses: peter-evans/create-or-update-comment@v2.1.1
if: github.event_name == 'pull_request' && inputs.comment-enable if: github.event_name == 'pull_request' && inputs.comment-enable
with: with:
comment-id: ${{ steps.fc.outputs.comment-id }} comment-id: ${{ steps.fc.outputs.comment-id }}

View File

@@ -23,12 +23,12 @@ A Reusable Workflow of the Docker GitHub Actions steps. Enhanced with learnings
3. Setup buildx for awesome and fast building via docker/setup-buildx-action 3. Setup buildx for awesome and fast building via docker/setup-buildx-action
4. Log into Docker Hub and/or GHCR 4. Log into Docker Hub and/or GHCR
5. Add labels and tags via docker/metadata-action 5. Add labels and tags via docker/metadata-action
6. Build and push image via docker/build-push-action with layer caching 6. Build and push image via docker/build-push-action with GitHub-based layer caching
7. Reports tags and labels in the PR comments 7. Reports tags and labels in the PR comments
## This repository is part of my example DevOps repos on GitHub Actions ## This repository is part of my example DevOps repos on GitHub Actions
- [bretfisher/github-actions-templates](https://github.com/BretFisher/github-actions-templates) - Main repository - [bretfisher/github-actions-templates](https://github.com/BretFisher/github-actions-templates) - Main reusable templates repository
- [bretfisher/super-linter-workflow](https://github.com/BretFisher/super-linter-workflow) - Reusable linter workflow - [bretfisher/super-linter-workflow](https://github.com/BretFisher/super-linter-workflow) - Reusable linter workflow
- (you are here) [bretfisher/docker-build-workflow](https://github.com/BretFisher/docker-build-workflow)- Reusable docker build workflow - (you are here) [bretfisher/docker-build-workflow](https://github.com/BretFisher/docker-build-workflow)- Reusable docker build workflow
- [bretfisher/docker-ci-automation](https://github.com/BretFisher/docker-ci-automation) - Step by step video and example of a Docker CI workflow - [bretfisher/docker-ci-automation](https://github.com/BretFisher/docker-ci-automation) - Step by step video and example of a Docker CI workflow
@@ -41,6 +41,7 @@ A Reusable Workflow of the Docker GitHub Actions steps. Enhanced with learnings
## 🎉🎉🎉 Join my container DevOps community 🎉🎉🎉 ## 🎉🎉🎉 Join my container DevOps community 🎉🎉🎉
- [My "Vital DevOps" Discord server](https://devops.fan) - [My Cloud Native DevOps Discord server](https://devops.fan)
- [My weekly YouTube Live show](https://bret.live) - [My weekly YouTube Live show](https://www.youtube.com/@BretFisher)
- [My weekly newsletter](https://www.bretfisher.com/newsletter)
- [My courses and coupons](https://www.bretfisher.com/courses) - [My courses and coupons](https://www.bretfisher.com/courses)