Skip to content

Commit

Permalink
chore(build): rework to target orange-master branch and align with ot…
Browse files Browse the repository at this point in the history
…her forks

We also bump github actions
  • Loading branch information
o-orand committed Mar 13, 2024
1 parent 643c0dc commit 0999652
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,64 @@ name: Docker Image CI

on:
push:
branches: [ "master" ]
branches: [ orange-master ]
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
- "v?[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches: [ "master" ]
branches: [ orange-master ]
workflow_dispatch:

env:
DOCKER_FILE_PATH: ./dockerfiles/alpine/Dockerfile
IMAGE: "ghcr.io/${{ github.repository }}"
DOCKERHUB_ORG: elpaasoci
OCI_IMAGE: concourse-pipeline-resource

jobs:
build_and_publish:
name: build and publish
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: extract github repo name
id: gh-repo-name
run: |
echo "OCI_IMAGE=$(basename ${{ github.repository }})" >> $GITHUB_ENV
shell: bash
-
name: publish concourse-pipeline-resource standard image
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v5.1.0
with:
context: ${{env.DOCKER_FILE_PATH}}
push: true
file: ./dockerfiles/alpine/Dockerfile
tags: |
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}}
${{ env.IMAGE}}:latest
${{ env.IMAGE}}:${{github.sha}}
-
name: publish concourse-pipeline-resource tagged image
if: github.ref_type == 'tag'
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v5.1.0
with:
push: true
file: ./dockerfiles/alpine/Dockerfile
context: ${{ env.DOCKER_FILE_PATH }}
tags: |
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.ref_name}}
ghcr.io/${{ github.repository }}:${{github.ref_name}}
${{env.IMAGE}}:${{github.ref_name}}

0 comments on commit 0999652

Please sign in to comment.