-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.46 KB
/
Copy pathsrv.cd.yaml
File metadata and controls
52 lines (50 loc) · 1.46 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
name: srv-cd
on:
push:
branches:
- master
tags:
- v*
paths:
- 'apps/srv/**'
jobs:
lint:
uses: ./.github/workflows/srv.lint.yaml
with:
working_directory: ./apps/srv
test:
uses: ./.github/workflows/srv.test.yaml
with:
working_directory: ./apps/srv
build:
runs-on: ubuntu-latest
needs: [ lint, test ]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/srv
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=semver,pattern={{version}},value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=sha,format=short
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v5
with:
context: ./apps/srv
file: ./apps/srv/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max