Skip to content

Publish new image of guestbook #1

Publish new image of guestbook

Publish new image of guestbook #1

Workflow file for this run

name: Guestbook - Publish new image
run-name: Publish new image of guestbook
on:
push:
branches:
- main
paths:
- 'guestbook/**'
permissions:
packages: write
attestations: write
contents: read
id-token: write
pull-requests: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-guestbook
jobs:
publish:
defaults:
run:
working-directory: guestbook
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
id: push
with:
context: guestbook
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:v1.0.${{ github.run_number }}