Update actions/checkout digest to b4ffde6 #14
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: Create and publish a Docker image | |
# Configure this workflow to run every time a change is pushed to the main | |
# branch or any branch whose name starts with `release/` or any time a tag is | |
# created; this workflow is also run any time a GitHub release is published. | |
# The image will be given a tag which is based on the trigger. | |
on: | |
push: | |
branches: [main, 'release/**'] | |
tags: ['*'] | |
release: | |
types: [published] | |
# Set up the container image specification to be `quay.io/pbench/file-relay`. | |
env: | |
REGISTRY: quay.io | |
ORGANIZATION: pbench | |
IMAGE_NAME: file-relay | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
# Set the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_ROBOT_TOKEN }} | |
# Extract metadata from the Git reference and the GitHub event. | |
# Subsequent steps can reference the values via `steps.meta.outputs.<key>`. | |
# The `images` value provides the name for the container image which is | |
# used in tags and labels. | |
- name: Extract metadata (tags, labels) from Git for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }} | |
# Build the container image based on the Dockerfile and the rest of the | |
# files found in the root of the Git checkout. If the build succeeds, | |
# the image is pushed to the registry indicated by the tags. | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
network: host | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |