Skip to content

Commit

Permalink
Merge pull request #90 from r-devel/gh-actions-update
Browse files Browse the repository at this point in the history
Gh actions update
  • Loading branch information
hturner authored May 27, 2024
2 parents 4d1b3c3 + edb9fcb commit 86aff12
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
name: Build and publish Docker image

on:
push:
pull_request:
branches: ["devel"]
schedule:
- cron: '0 0 1,15 * *'
types: [closed]
paths:
- 'dockerfile'
- 'reinstall-cmake.sh'


env:
Expand All @@ -18,7 +20,7 @@ env:

jobs:
build-and-push-image:
if: ${{ contains(github.event.head_commit.message, 'Build image') }}
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build-mkdocs-website.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Build MKDocs website

on:
push:
pull_request:
branches: ["devel"]
types: [closed]
paths:
- 'docs/**/**'
- 'mkdocs.yml'

jobs:
build-and-deploy:
if: ${{ contains(github.event.head_commit.message, 'Build website') }}
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -31,4 +35,4 @@ jobs:
mkdocs gh-deploy --force
git push origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/schedule-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build and publish Docker image(Schedule Workflow)

on:
pull_request:
branches: ["devel"]
schedule:
- cron: '0 0 1,15 * *'


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract version number
run: |
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{ env.VERSION }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
"CONTAINER_VERSION=${{ env.VERSION }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 86aff12

Please sign in to comment.