File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docker image
2+
3+ on :
4+ push :
5+ # Publish `main` as Docker `latest` image.
6+ branches :
7+ - main
8+
9+ # Publish `v1.2.3` tags as releases.
10+ tags :
11+ - v*
12+
13+ workflow_dispatch :
14+ # Allow manually triggered builds too.
15+
16+ env :
17+ PYTHON_IMAGE_NAME : python-backend
18+ JAVA_IMAGE_NAME : java-backend
19+ AEROAPPS_VERSION : latest
20+
21+ jobs :
22+ # Push image to GitHub Packages.
23+ # See also https://docs.docker.com/docker-hub/builds/
24+ push :
25+
26+ runs-on : ubuntu-latest
27+ if : github.event_name == 'push'
28+
29+ steps :
30+ - uses : actions/checkout@v2
31+
32+ - name : Build images
33+ run : |
34+ # Strip git ref prefix from version
35+ AEROAPPS_VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
36+
37+ # Use Docker `latest` tag convention
38+ [ "$AEROAPPS_VERSION" == "main" ] && AEROAPPS_VERSION=latest
39+
40+ echo "AEROAPPS_VERSION=$AEROAPPS_VERSION" >> $GITHUB_ENV
41+
42+ docker-compose build --parallel $JAVA_IMAGE_NAME $PYTHON_IMAGE_NAME
43+
44+ - name : Log into registry
45+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ secrets.GHCR_USER }} --password-stdin
46+
47+ - name : Push images
48+ run :
49+ docker-compose push $JAVA_IMAGE_NAME $PYTHON_IMAGE_NAME
You can’t perform that action at this time.
0 commit comments