1+ name : Docker Image CI
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+ tags :
8+ - " [0-9]+.[0-9]+.[0-9]+*"
9+ pull_request :
10+ branches : [ "main" ]
11+ env :
12+ DOCKERHUB_ORG : elpaasoci
13+ OCI_IMAGE : concourse-fly-resource
14+
15+ jobs :
16+ build_and_publish :
17+ name : build and publish
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - uses : actions/checkout@v3
22+ -
23+ name : Login to DockerHub
24+ uses : docker/login-action@v2
25+ with :
26+ username : ${{ secrets.DOCKERHUB_USERNAME }}
27+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
28+ -
29+ name : Login to GitHub Container Registry
30+ uses : docker/login-action@v2
31+ with :
32+ registry : ghcr.io
33+ username : ${{ github.repository_owner }}
34+ password : ${{ secrets.GITHUB_TOKEN }}
35+ -
36+ name : publish git-branch-heads-resource standard image
37+ uses : docker/build-push-action@v4.0.0
38+ with :
39+ push : true
40+ tags : |
41+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:latest
42+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.sha}}
43+ ghcr.io/${{ github.repository }}:latest
44+ ghcr.io/${{ github.repository }}:${{github.sha}}
45+ -
46+ name : publish git-branch-heads-resource tagged image
47+ if : github.ref_type == 'tag'
48+ uses : docker/build-push-action@v4.0.0
49+ with :
50+ push : true
51+ tags : |
52+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.ref_name}}
53+ ghcr.io/${{ github.repository }}:${{github.ref_name}}
54+ -
55+ name : Update repo description
56+ uses : peter-evans/dockerhub-description@v3
57+ with :
58+ username : ${{ secrets.DOCKERHUB_USERNAME }}
59+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
60+ repository : ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}
61+ short-description : ${{ github.event.repository.description }} - Orange Cloudfoundry fork.
0 commit comments