Skip to content

Commit

Permalink
chore(build): use GitHub action to build and publish image
Browse files Browse the repository at this point in the history
  • Loading branch information
o-orand committed Mar 27, 2023
1 parent c8ce6d1 commit c41b7cc
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
61 changes: 61 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/[email protected]
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/[email protected]
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.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ Concourse Fly Resource

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

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

Compatibility matrix:

| Concourse Version | Resource Image Tag |
| ----------------- | ------------------ |
| `5.x` | `2.x`, `latest` |
| `4.x` | `2.x`, `latest` |
| `3.x` | `1.x` |
| `2.x` and below | NOPE |
|-------------------| ------------------ |
| `7.x` | `2.x`, `latest` |
| `6.x` | `2.x`, `latest` |
| `5.x` | `2.x`, `latest` |
| `4.x` | `2.x`, `latest` |
| `3.x` | `1.x` |
| `2.x` and below | NOPE |

## Resource Type Configuration

Expand All @@ -22,7 +24,7 @@ resource_types:
- name: fly
type: docker-image
source:
repository: troykinsella/concourse-fly-resource
repository: elpaasoci/concourse-fly-resource
tag: latest
```
Expand Down

0 comments on commit c41b7cc

Please sign in to comment.