Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

rename docker build action step #9

rename docker build action step

rename docker build action step #9

Workflow file for this run

name: Build and publish image to ghcr.io/epics-containers
on:
push:
pull_request:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine container image tag to use
id: tag
run: |
# tag is branch name or tag if there is a tag
echo ::set-output name=image_tag::${GITHUB_REF##*/}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/epics-containers
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}