Skip to content

add: sample workflow #3

add: sample workflow

add: sample workflow #3

Workflow file for this run

name: Docker Release AMD64
on:
pull_request:
branches:
- main
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: self-hosted
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install Cosign
uses: sigstore/[email protected]
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Change directory to the projects folder
- name: Change directory to projects folder
run: cd projects
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build Docker image
# https://github.com/docker/build-push-action
- name: Build Docker image
id: build
run: docker build -f projects/Dockerfile -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest .