Repository navigation
93 lines (78 loc) · 2.7 KB
/
Copy pathrelease.yml
File metadata and controls
93 lines (78 loc) · 2.7 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Release
# Cutting a release is a single action: push a SemVer tag (e.g. `v0.1.0`). This builds and
# publishes the API and Web container images to the GitHub Container Registry (populating the
# repo's Packages section), then creates the GitHub Release with auto-generated notes.
on:
push:
tags: ['v*']
permissions:
contents: write # create the GitHub Release
packages: write # push images to ghcr.io
jobs:
images:
name: Publish ${{ matrix.name }} image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: api
image: ghcr.io/softpython2884/opencoperlock-api
dockerfile: infra/Dockerfile.api
build_args: ''
- name: web
image: ghcr.io/softpython2884/opencoperlock-web
dockerfile: infra/Dockerfile.web
build_args: |
NEXT_PUBLIC_API_URL=http://localhost:4000
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive image tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.build_args }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: GitHub Release
needs: images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
body: |
## OpenCoperLock ${{ github.ref_name }}
Self-hostable private cloud — a classic Drive plus advanced acquisition & security tooling.
### Container images
Pull the published images from the GitHub Container Registry:
```bash
docker pull ghcr.io/softpython2884/opencoperlock-api:${{ github.ref_name }}
docker pull ghcr.io/softpython2884/opencoperlock-web:${{ github.ref_name }}
```
See `infra/docker-compose.yml` and `docs/DEPLOYMENT.md` to deploy.
---