-
Notifications
You must be signed in to change notification settings - Fork 252
101 lines (98 loc) · 3.81 KB
/
Copy pathdocker.yml
File metadata and controls
101 lines (98 loc) · 3.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
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
94
95
96
97
98
99
100
101
name: Build Docker Images
on:
push:
branches:
- 'master'
- 'release/*'
tags:
- "v*.*.*"
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "arm64,arm"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the container registry
uses: docker/login-action@v3 # ref: https://github.com/marketplace/actions/docker-login
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Version
run: echo "VERSION=$(head -n 1 VERSION)" >> ${GITHUB_ENV}
- name: Lowercase the server container image name
run: echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> ${GITHUB_ENV}
- name: Build and push Django
uses: docker/build-push-action@v6
with:
file: ./compose/production/django/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_django:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_django:latest
- name: Build and push Postgres
uses: docker/build-push-action@v6
with:
file: ./compose/production/postgres/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_postgres:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_postgres:latest
- name: Build and push Nginx
uses: docker/build-push-action@v6
with:
file: ./compose/production/nginx/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_nginx:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_nginx:latest
- name: Build and push Redis
uses: docker/build-push-action@v6
with:
file: ./compose/production/redis/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_redis:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_redis:latest
- name: Build and push Hasura
uses: docker/build-push-action@v6
with:
file: ./compose/production/hasura/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_hasura:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_hasura:latest
- name: Build and push Collab Server
uses: docker/build-push-action@v6
with:
file: ./compose/production/collab-server/Dockerfile
push: ${{ github.ref_type == 'tag' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_collab_server:${{env.VERSION}}
${{ env.REGISTRY }}/${{ env.OWNER }}/ghostwriter_collab_server:latest