File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : docker-build-and-publish
2+
3+ on :
4+ push :
5+ branches : none
6+ pull_request :
7+ branches : none
8+ workflow_dispatch :
9+
10+ jobs :
11+ build-and-publish-containers :
12+ runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ service :
16+ - auth
17+ - blog
18+ - character
19+ - discovery
20+ - gateway
21+ - rss
22+
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@v3
26+
27+ # Generate a timestamp and store it in an environment variable
28+ - name : Set Timestamp
29+ id : timestamp
30+ run : echo "::set-output name=timestamp::$(date +%s)"
31+
32+ - name : Build Docker Image
33+ working-directory : ${{ matrix.service }}
34+ run : |
35+ docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/org-sog-hq-${{ matrix.service }}:${{ steps.timestamp.outputs.timestamp }}
36+
37+ - name : Log into Docker registry
38+ run : echo "${{ secrets.WORKFLOW_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
39+
40+ - name : Push Docker Image to GitHub Packages
41+ run : |
42+ docker push ghcr.io/${{ github.repository_owner }}/org-sog-hq-${{ matrix.service }}:${{ steps.timestamp.outputs.timestamp }}
You can’t perform that action at this time.
0 commit comments