15
15
16
16
17
17
jobs :
18
+ timestamp :
19
+ runs-on : ubuntu-latest
20
+ outputs :
21
+ timestamp : ${{ steps.timestamp.outputs.timestamp }}
22
+ steps :
23
+ - id : timestamp
24
+ run : |
25
+ timestamp=`date +%Y%m%d-%H%M`
26
+ echo "timestamp=$timestamp"
27
+ echo "timestamp=$timestamp" >> $GITHUB_OUTPUT
28
+
18
29
base :
19
30
# `unbuntu-20.04-8core` for arch amd64 non-scheduled builds
20
31
# `unbuntu-20.04` for arch amd64 scheduled builds
@@ -25,58 +36,54 @@ jobs:
25
36
matrix :
26
37
arch : [amd64, arm64]
27
38
timeout-minutes : ${{ (github.event_name != 'schedule' && 30) || ((matrix.arch == 'arm64' && 60) || 30) }}
39
+ needs : timestamp
40
+ env :
41
+ ARCH : ${{matrix.arch}}
42
+ TIMESTAMP : ${{ needs.timestamp.outputs.timestamp }}
28
43
steps :
29
44
- uses : actions/checkout@v3
30
45
with :
31
46
fetch-depth : 1
32
- - name : Set arch helper output
33
- id : arch-helper
34
- run : |
35
- echo "arch_postfix_dash=${{ (matrix.arch == 'arm64' && '-arm64') || '' }}" >> $GITHUB_OUTPUT
36
- echo "arch_postfix_underscore=${{ (matrix.arch == 'arm64' && '_arm64') || '' }}" >> $GITHUB_OUTPUT
37
- - name : build slim image
38
- run : |
39
- cd image && ruby auto_build.rb base_slim${{ steps.arch-helper.outputs.arch_postfix_underscore }}
40
- - name : tag slim images
41
- id : tag-images
47
+ - name : build & tag slim image
42
48
run : |
43
- TAG=`date +%Y%m%d-%H%M`
44
- echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT
45
- docker tag discourse/base:build_slim${{ steps.arch-helper.outputs.arch_postfix_underscore }} discourse/base:2.0.$TAG-slim${{ steps.arch-helper.outputs.arch_postfix_dash }}
46
- docker tag discourse/base:build_slim${{ steps.arch-helper.outputs.arch_postfix_underscore }} discourse/base:slim${{ steps.arch-helper.outputs.arch_postfix_dash }}
47
- - name : build release image
49
+ cd image && ruby auto_build.rb base_slim_$ARCH
50
+ docker tag discourse/base:build_slim_$ARCH discourse/base:2.0.$TIMESTAMP-slim-$ARCH
51
+ docker tag discourse/base:build_slim_$ARCH discourse/base:slim-$ARCH
52
+ - name : build & tag release image
48
53
run : |
49
- cd image && ruby auto_build.rb base${{ steps.arch-helper.outputs.arch_postfix_underscore }}
50
- - name : tag amd64 release images
51
- run : |
52
- TAG=${{ steps.tag-images.outputs.tag }}
53
- docker tag discourse/base:build${{ steps.arch-helper.outputs.arch_postfix_underscore }} discourse/base:2.0.$TAG${{ steps.arch-helper.outputs.arch_postfix_dash }}
54
- docker tag discourse/base:build${{ steps.arch-helper.outputs.arch_postfix_underscore }} discourse/base:release${{ steps.arch-helper.outputs.arch_postfix_dash }}
54
+ cd image && ruby auto_build.rb base_$ARCH
55
+ docker tag discourse/base:build_$ARCH discourse/base:2.0.$TIMESTAMP-$ARCH
56
+ docker tag discourse/base:build_$ARCH discourse/base:release-$ARCH
55
57
- name : build test_build image
56
58
run : |
57
- cd image && ruby auto_build.rb discourse_test_build${{ steps.arch-helper.outputs.arch_postfix_underscore }}
58
- - name : run specs
59
+ cd image && ruby auto_build.rb discourse_test_build_$ARCH
60
+ - name : run specs using test_build image
61
+ run : |
62
+ docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build_$ARCH
63
+ - name : build & tag dev image
59
64
run : |
60
- docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build${{ steps.arch-helper.outputs.arch_postfix_underscore }}
65
+ cd image && ruby auto_build.rb discourse_dev_build_$ARCH
66
+ docker tag discourse/discourse_dev:build_$ARCH discourse/discourse_dev:$TIMESTAMP-$ARCH
61
67
- name : Print summary
62
68
run : |
63
69
docker images discourse/base
64
70
- name : push to dockerhub
65
- if : success() && ( github.ref == 'refs/heads/main')
71
+ if : github.ref == 'refs/heads/main'
66
72
env :
67
73
DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
68
74
run : |
69
- TAG=${{ steps.tag-images.outputs.tag }}
70
75
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
71
- docker push discourse/base:2.0.$TAG-slim${{ steps.arch-helper.outputs.arch_postfix_dash }}
72
- docker push discourse/base:slim${{ steps.arch-helper.outputs.arch_postfix_dash }}
73
- docker push discourse/base:2.0.$TAG${{ steps.arch-helper.outputs.arch_postfix_dash }}
74
- docker push discourse/base:release${{ steps.arch-helper.outputs.arch_postfix_dash }}
76
+ docker push discourse/base:2.0.$TIMESTAMP-slim-$ARCH
77
+ # docker push discourse/base:slim-$ARCH
78
+ docker push discourse/base:2.0.$TIMESTAMP-$ARCH
79
+ # docker push discourse/base:release-$ARCH
80
+ docker push discourse/discourse_dev:$TIMESTAMP-$ARCH
75
81
- name : Push discourse/base:aarch64 image for backwards compatibility
76
- if : success() && (github.ref == 'refs/heads/main') && (matrix.arch == 'arm64')
82
+ if : (github.ref == 'refs/heads/main') && (matrix.arch == 'arm64')
77
83
run : |
78
- docker tag discourse/base:release${{ steps.arch-helper.outputs.arch_postfix_dash }} discourse/base:aarch64
84
+ docker tag discourse/base:release-$ARCH discourse/base:aarch64
79
85
docker push discourse/base:aarch64
86
+
80
87
test :
81
88
runs-on : ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
82
89
timeout-minutes : 30
@@ -118,62 +125,23 @@ jobs:
118
125
docker push discourse/discourse_test:slim
119
126
docker push discourse/discourse_test:slim-browsers
120
127
docker push discourse/discourse_test:release
121
- timestamp :
122
- runs-on : ubuntu-latest
123
- outputs :
124
- timestamp : ${{ steps.timestamp.outputs.timestamp }}
125
- steps :
126
- - id : timestamp
127
- run : |
128
- timestamp=`date +%Y%m%d-%H%M`
129
- echo "timestamp=$timestamp"
130
- echo "timestamp=$timestamp" >> $GITHUB_OUTPUT
131
- dev :
132
- # `unbuntu-20.04-8core` for arch amd64 non-scheduled builds
133
- # `unbuntu-20.04` for arch amd64 scheduled builds
134
- # `unbuntu-20.04-8core-arm` for arch arm64 non-scheduled builds
135
- # `unbuntu-20.04-2core-arm` for arch arm64 scheduled builds
136
- runs-on : ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || (( matrix.arch == 'arm64' && '-2core' ) || '') }}${{ (matrix.arch == 'arm64') && '-arm' || '' }}
137
- strategy :
138
- matrix :
139
- arch : [amd64, arm64]
140
- timeout-minutes : 30
141
- needs : timestamp
142
- env :
143
- TIMESTAMP : ${{ needs.timestamp.outputs.timestamp }}
144
- steps :
145
- # - *install_docker
146
- # - *install_ruby
147
- - uses : actions/checkout@v3
148
- with :
149
- fetch-depth : 1
150
- - name : build discourse_dev image
151
- run : |
152
- cd image && ruby auto_build.rb discourse_dev${{ matrix.arch == 'arm64' && '_arm64' || ''}}
153
- - name : push to dockerhub
154
- if : success() # && (github.ref == 'refs/heads/main')
155
- env :
156
- DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
157
- run : |
158
- docker tag discourse/discourse_dev:build discourse/discourse_dev:${{matrix.arch}}-$TIMESTAMP
159
- docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
160
- docker push discourse/discourse_dev:${{ matrix.arch }}-$TIMESTAMP
161
- stamp_dev :
162
- runs-on : ubuntu-latest
163
- needs : [dev, timestamp]
164
- env :
165
- TIMESTAMP : ${{ needs.timestamp.outputs.timestamp }}
166
- # if: github.ref == 'refs/heads/main'
167
- steps :
168
- - uses : actions/checkout@v3
169
- with :
170
- fetch-depth : 1
171
- - name : stamp discourse_dev image
172
- run : |
173
- docker login --username discoursebuild --password ${{ secrets.DOCKERHUB_PASSWORD }}
174
128
175
- docker manifest create discourse/discourse_dev:release-$TIMESTAMP \
176
- -a discourse/discourse_dev:amd64-$TIMESTAMP \
177
- -a discourse/discourse_dev:arm64-$TIMESTAMP
129
+ # stamp_dev:
130
+ # runs-on: ubuntu-latest
131
+ # needs: [dev, timestamp]
132
+ # env:
133
+ # TIMESTAMP: ${{ needs.timestamp.outputs.timestamp }}
134
+ # # if: github.ref == 'refs/heads/main'
135
+ # steps:
136
+ # - uses: actions/checkout@v3
137
+ # with:
138
+ # fetch-depth: 1
139
+ # - name: stamp discourse_dev image
140
+ # run: |
141
+ # docker login --username discoursebuild --password ${{ secrets.DOCKERHUB_PASSWORD }}
142
+
143
+ # docker manifest create discourse/discourse_dev:release-$TIMESTAMP \
144
+ # -a discourse/discourse_dev:amd64-$TIMESTAMP \
145
+ # -a discourse/discourse_dev:arm64-$TIMESTAMP
178
146
179
- docker manifest push discourse/discourse_dev:release-$TIMESTAMP
147
+ # docker manifest push discourse/discourse_dev:release-$TIMESTAMP
0 commit comments