Repository navigation
57 lines (54 loc) · 1.81 KB
/
Copy pathdeploy.yml
File metadata and controls
57 lines (54 loc) · 1.81 KB
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
52
53
54
55
56
57
name: Docker Build and Push
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=raw,value=pr-${{ github.event.number }}-{{date 'YYYYMMDDHHmmss'}},enable=${{ github.event_name == 'pull_request' }}
type=raw,value=edge-{{date 'YYYYMMDDHHmmss'}},enable={{is_default_branch}}
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
# appthrust.dev runtimes are linux/amd64. Adding linux/arm64 here builds
# under QEMU emulation and multiplied build time (166s -> 39s measured on
# a Next.js app after removing it). For an arm64 runtime, build natively
# on an ubuntu-24.04-arm runner and merge manifests instead.
platforms: linux/amd64