Skip to content

Use latest tag

Use latest tag #4

Workflow file for this run

name: Build and Push Docker Image for lbtest/r-shiny
on:
push:
branches: [ "main" ]
paths: [ "r-shiny/**"]
pull_request:
branches: [ "main" ]
paths: [ "r-shiny/**"]
env:
SHINY_SETUP: r-shiny
permissions:
packages: write
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: 'Docker metadata'
id: meta
uses: docker/metadata-action@v5
with:
labels: |
maintainer=Peter Solymos
org.opencontainers.image.title=LB Test
org.opencontainers.image.description=Load balancing test app
org.opencontainers.image.vendor=Hosting Shiny Book Project
images: |
ghcr.io/${{ github.repository }}/${{ env.SHINY_SETUP }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Build and push'
uses: docker/build-push-action@v6
with:
context: ./${{ env.SHINY_SETUP }}
file: ./${{ env.SHINY_SETUP }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}