-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (42 loc) · 1.4 KB
/
sample.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 .