-
-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (28 loc) · 862 Bytes
/
docker.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
name: Docker
on:
push:
branches: [main]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and Push Docker Image
run: |
image="ghcr.io/msrd0/element"
docker pull "$image:cache" || true
docker build . \
--pull \
--target builder \
--cache-from "$image:cache" \
--tag "$image:cache"
docker build . \
--pull \
--cache-from "$image:cache" \
--tag "$image"
version="$(docker run --rm "$image" /bin/element version)"
docker tag "$image" "$image:$version"
docker login -u msrd0 -p "${{secrets.GITHUB_TOKEN}}" ghcr.io
docker push "$image:cache"
docker push "$image:$version"
docker push "$image"