Skip to content

Commit

Permalink
Add GHCR build
Browse files Browse the repository at this point in the history
  • Loading branch information
almahmoud committed Nov 7, 2022
1 parent 0690a1b commit 4b85659
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build_ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build container image for GHCR
on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '0 18 * * 5'

jobs:
build:
strategy:
fail-fast: false
matrix:
base:
- {directory: 'anvil-rstudio-bioconductor'}
- {directory: 'anvil-rstudio-bioconductor-devel'}
name: Build branch images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set version
id: version-meta
run: echo "CONTAINER_VERSION=$(cat ${{ matrix.base.directory }}/VERSION)" >> $GITHUB_OUTPUT

- name: Extract metadata for container image
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/anvilproject/${{ matrix.base.directory }}
tags: |
type=raw,value=${{ steps.version-meta.outputs.CONTAINER_VERSION }}
- name: Build and push container image to GHCR
uses: docker/build-push-action@v3
with:
context: ${{ matrix.base.directory }}
file: ${{ matrix.base.directory }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4b85659

Please sign in to comment.