Build Docker #787
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" | |
push: | |
branches: | |
- master | |
jobs: | |
generate: | |
name: Build Docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/bimberlabinternal/rdiscvr | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2.1.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.2.1 | |
with: | |
# Use the previous version of buildx to force docker to save a V1 image, | |
# since Exacloud's outdated docker version cannot handle V2/OCI: | |
version: v0.9.1 | |
- name: Login to GitHub Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.PAT }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v3.3.0 | |
with: | |
context: . | |
file: ./Dockerfile | |
pull: true | |
push: ${{github.ref == 'refs/heads/master'}} | |
tags: ghcr.io/bimberlabinternal/rdiscvr:latest | |
secrets: | | |
GIT_AUTH_TOKEN=${{ secrets.PAT }} | |
GITHUB_PAT=${{ secrets.PAT }} | |
labels: | | |
${{ steps.docker_meta.outputs.labels }} | |
org.opencontainers.image.title=rdiscvr | |
org.opencontainers.image.description=This in an R package that provides helper functions to query data in LabKey/DISCVR modules. This is mainly for internal use by the Bimber Lab. | |