forked from troykinsella/concourse-fly-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.88 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches:
- "main"
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches: [ "main" ]
env:
DOCKERHUB_ORG: elpaasoci
OCI_IMAGE: concourse-fly-resource
jobs:
build_and_publish:
name: build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: publish git-branch-heads-resource standard image
uses: docker/build-push-action@v4.0.0
with:
push: true
tags: |
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:latest
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.sha}}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{github.sha}}
-
name: publish git-branch-heads-resource tagged image
if: github.ref_type == 'tag'
uses: docker/build-push-action@v4.0.0
with:
push: true
tags: |
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.ref_name}}
ghcr.io/${{ github.repository }}:${{github.ref_name}}
-
name: Update repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}
short-description: ${{ github.event.repository.description }} - Orange Cloudfoundry fork.