Skip to content

Release Image (Development) #58

Release Image (Development)

Release Image (Development) #58

Workflow file for this run

name: Docker - Release Image (Development)
on:
push:
branches:
- development
pull_request:
branches:
- development
paths:
- ".github/workflows/release-development.yaml"
- "app/**/*"
- "Dockerfile"
pull_request_review:
types:
- submitted
jobs:
release-docker:
name: Docker - Release Image (Development)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push PR image
uses: docker/build-push-action@v2
if: github.event_name == 'pull_request' && github.event.review.state == 'approved' # If it's an approved PR, build and push with the PR number
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:pr-${{ github.event.number }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
build-args: |
BUILDKIT_INLINE_CACHE=1
- name: Build and push development tagged image
uses: docker/build-push-action@v2
if: github.event_name == 'push' && github.ref == 'refs/heads/development'
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:development
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
build-args: |
BUILDKIT_INLINE_CACHE=1