-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (121 loc) · 5.3 KB
/
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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Docker
on:
push:
jobs:
main:
strategy:
matrix:
include:
- unity_docker_image: unityci/editor:2022.3.12f1-webgl-3.0.0
service_name: asset-bundle-converter
platform_target: webgl
- unity_docker_image: unityci/editor:2022.3.12f1-windows-mono-3.0.0
service_name: asset-bundle-converter-windows
platform_target: windows
- unity_docker_image: unityci/editor:2022.3.12f1-mac-mono-3.0.0
service_name: asset-bundle-converter-mac
platform_target: mac
runs-on: ubuntu-latest
steps:
- name: Remove unused Haskell GHC CodeQL Julia Chromium Swift
run: |
sudo apt-get remove -y ghc haskell-platform julia
sudo apt-get autoremove -y
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/bin/ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/julia1.10.4
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/share/swift
- uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ matrix.service_name }}
# layers: true
tags: next ${{ github.sha }} ${{ inputs.docker-tag }}
dockerfiles: |
./Dockerfile
build-args: |
COMMIT_HASH=${{ github.sha }}
UNITY_DOCKER_IMAGE=${{ matrix.unity_docker_image }}
PLATFORM_TARGET=${{ matrix.platform_target }}
- name: Debugging
run: |
echo "Image: ${{ matrix.service_name }}"
echo "Tags: next ${{ github.sha }} ${{ inputs.docker-tag }}"
echo "Build Args: COMMIT_HASH=${{ github.sha }} UNITY_DOCKER_IMAGE=${{ matrix.unity_docker_image }} PLATFORM_TARGET=${{ matrix.platform_target }}"
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10
buildah images
docker images
df -h
docker system df
for img in $(buildah images -q --filter=reference=docker.io/unityci/editor) $(buildah images -q --filter=reference=docker.io/library/node); do
buildah rmi $img
done
sudo apt-get purge google-chrome-stable microsoft-edge-stable -y && sudo apt-get autoremove -y
docker image prune -af
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10
buildah images
df -h
docker system df
buildah push localhost/${{ matrix.service_name }}:${{ github.sha }} docker-archive:temp.tar
gzip temp.tar
docker load -i temp.tar.gz
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10
df -h
docker system df
rm -f temp.tar.gz
sudo find / -type d \( -name "mnt" -o -name "proc" \) -prune -o -type f -exec du -h {} + | sort -rh | head -n 10
df -h
docker images
- name: Create $(pwd)/tmp/Unity/Unity_lic.ulf
run: mkdir -p $(pwd)/tmp/Unity && echo "$UNITY_2021_ULF" > $(pwd)/tmp/Unity/Unity_lic.ulf
env:
UNITY_2021_ULF: ${{ secrets.UNITY_2021_ULF }}
- name: Run tests
run: |
docker run --rm \
-v $(pwd)/tmp/Unity:/root/.local/share/unity3d/Unity \
-v $(pwd):/app \
localhost/${{ matrix.service_name }}:${{ github.sha }} \
sh -c "cd /app ; ls -la ; chmod +x ci-editmode-test.sh ; ./ci-editmode-test.sh"
- name: Run test conversion of urn:decentraland:off-chain:base-avatars:brown_pants
run: |
docker run --rm \
-v $(pwd)/tmp/Unity:/root/.local/share/unity3d/Unity \
localhost/${{ matrix.service_name }}:${{ github.sha }} \
node --trace-warnings --abort-on-uncaught-exception --unhandled-rejections=strict dist/test-conversion.js \
--baseUrl https://peer.decentraland.org/content \
--pointer urn:decentraland:off-chain:base-avatars:brown_pants \
--outDir /tmp-ab \
--logFile /tmp-ab/log.txt
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
# if: ${{ github.ref == 'refs/heads/main' }}
with:
image: ${{ steps.build-image.outputs.image }}
# tags: ${{ steps.build-image.outputs.tags }}
tags: ${{ github.sha }}
registry: quay.io/decentraland
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
# if: ${{ github.ref == 'refs/heads/main' }}
- name: Trigger deployment
id: deploy
uses: decentraland/dcl-deploy-action@main
if: ${{ github.ref == 'refs/heads/main' }}
with:
dockerImage: quay.io/decentraland/${{ matrix.service_name }}:${{ github.sha }}
serviceName: ${{ matrix.service_name }}
env: dev prd
token: ${{ secrets.GITHUB_TOKEN }}