Create and publish a Docker image #4
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 | |
on: | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Lowercase repository name | |
id: lowercase | |
run: echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT | |
- name: Log in to GHCR | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
id: push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./workshop/scenario_1/Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ steps.lowercase.outputs.repository }}/bitcoinero:latest | |
ghcr.io/${{ steps.lowercase.outputs.repository }}/bitcoinero:${{ github.run_id }} |