This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
Bump nicolaiunrein/cargo-get from 8ad2b01b5ae4099470f6f83551a770bbf28fd3b8 to 736b6ea27d5f971acb63d13eb250ef25cccf54cf #49
Workflow file for this run
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-docker | |
concurrency: | |
cancel-in-progress: true | |
group: build-docker-${{ github.event.pull_request.number || github.sha }} | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- image-repo: ${{ github.repository }} | |
dockerfile: Dockerfile | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up QEMU needed for Docker | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
logout: false | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
- id: readme | |
name: Read README | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: README.md | |
- name: Login to Docker hub | |
uses: docker/login-action@v2 | |
with: | |
logout: false | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
registry: docker.io | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
- id: meta | |
name: Docker metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ matrix.image-repo }} | |
labels: | | |
org.opencontainers.image.description: ${{ steps.readme.outputs.content }} | |
- id: short-sha | |
name: Set image tag | |
run: | | |
echo "short-sha=$(echo ${{ github.sha }} | cut -c 1-7 )" >> $GITHUB_OUTPUT | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
file: ${{ matrix.dockerfile }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: | | |
${{ env.REGISTRY }}/${{ matrix.image-repo }}:${{ steps.short-sha.outputs.short-sha }} | |
${{ env.REGISTRY }}/${{ matrix.image-repo }}:latest | |
${{ matrix.image-repo }}:${{ steps.short-sha.outputs.short-sha }} | |
${{ matrix.image-repo }}:latest |