Skip to content

Commit c41b7cc

Browse files
committed
chore(build): use GitHub action to build and publish image
1 parent c8ce6d1 commit c41b7cc

File tree

3 files changed

+77
-7
lines changed

3 files changed

+77
-7
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/docker-image.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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.

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ Concourse Fly Resource
33

44
A [Concourse](http://concourse.ci/) resource for manipulating `fly`.
55

6-
See [Docker Hub](https://cloud.docker.com/repository/docker/troykinsella/concourse-fly-resource)
6+
See [Docker Hub](https://cloud.docker.com/repository/docker/elpaasoci/concourse-fly-resource)
77
for tagged image versions available.
88

99
Compatibility matrix:
1010

1111
| Concourse Version | Resource Image Tag |
12-
| ----------------- | ------------------ |
13-
| `5.x` | `2.x`, `latest` |
14-
| `4.x` | `2.x`, `latest` |
15-
| `3.x` | `1.x` |
16-
| `2.x` and below | NOPE |
12+
|-------------------| ------------------ |
13+
| `7.x` | `2.x`, `latest` |
14+
| `6.x` | `2.x`, `latest` |
15+
| `5.x` | `2.x`, `latest` |
16+
| `4.x` | `2.x`, `latest` |
17+
| `3.x` | `1.x` |
18+
| `2.x` and below | NOPE |
1719

1820
## Resource Type Configuration
1921

@@ -22,7 +24,7 @@ resource_types:
2224
- name: fly
2325
type: docker-image
2426
source:
25-
repository: troykinsella/concourse-fly-resource
27+
repository: elpaasoci/concourse-fly-resource
2628
tag: latest
2729
```
2830

0 commit comments

Comments
 (0)