Skip to content

bug fix in job name #116

bug fix in job name

bug fix in job name #116

name: Create Docker image and publish to GH Packages
on:
push:
branches: [ main , 27-document-and-track-container-configuration] # create a new version whenever we push to main
schedule:
- cron: "12 2 2 * *" # run at 2:12 of the 2nd of every month
env:
DOCKER_REGISTRY: ghcr.io # where to register the image
REPO_PATH: github.com/furrer-lab/abn.git
# REPO_PATH: github.com:furrer-lab/abn.git # for private repo cloned via ssh
# Set the path to the package where the DESCRIPTION file can be found
PACKAGE_PATH: ${{ vars.PACKAGE_PATH || './' }}
JAGS: JAGS-4.3.2
CHGLOG_RELEASE: git-chglog_0.15.4_linux_amd64
CHGLOG_PATH: https://github.com/git-chglog/git-chglog/releases/download/v0.15.4
jobs:
increment-tag:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
VERSION: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Auto increment calver version
uses: reecetech/[email protected]
id: version
with:
scheme: calver
build-and-push:
runs-on: ubuntu-latest
needs: increment-tag
env:
CUSTOM_TAG: "${{ needs.increment-tag.outputs.VERSION }}"
permissions: # for `GITHUB_TOKEN`
contents: read
packages: write
strategy:
fail-fast: false
matrix:
target-os: ['debian', 'fedora']
compiler: ['gcc', 'clang']
r-version: ['devel', 'release', 'patched']
exclude:
- target-os: 'fedora'
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
r-version: 'release'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tags and labels
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
# TODO: set a proper name of the image (same as in context below)
images: ${{ env.DOCKER_REGISTRY}}/${{ format('{0}/{1}/{2}/{3}/abn', github.repository, matrix.target-os, matrix.compiler, matrix.r-version ) }}
tags: | # set Docker tags to git tags
type=raw,value=${{ env.CUSTOM_TAG }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
#type=semver,pattern={{version}}
# For private repo cloned via ssh we need a deploy key
# - name: Write the ssh key file
# run: |
# echo "${{ secrets.DEVEL_ABN_DEPLOY }}" >> ssh_key
# shell: bash
- name: Build and push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ${{ format('./containers/{0}/', matrix.target-os ) }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TARGET_OS=${{ matrix.target-os }}
COMPILER=${{ matrix.compiler }}
R_VERSION=${{ matrix.r-version }}
PACKAGE_PATH=${{ env.PACKAGE_PATH}}
REPO_PATH=${{ env.REPO_PATH }}
JAGS=${{ env.JAGS}}
# For private repo cloned via ssh
# secret-files: |
# key=./ssh_key
container-integrity-and-config

Check failure on line 115 in .github/workflows/create-publish-docker.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-publish-docker.yml

Invalid workflow file

You have an error in your yaml syntax on line 115
runs-on: ubuntu-22.04
needs: build-and-push
container:
image: ${{ vars.CONTAINER_SOURCE }}/${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.r-version }}/abn:${{ vars.CONTAINER_VERSION || 'latest' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
target-os: ['debian', 'fedora']
compiler: ['gcc', 'clang']
r-version: ['devel', 'release', 'patched']
exclude:
- target-os: 'fedora'
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
r-version: 'release'
fail-fast: false
steps:
- name: Write out configuration
run: |
Rscirpt -e "sessionInfo()" > docs/${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.r-version }}.md
Rscirpt -e "ip=as.data.frame(installed.packages()[,c(1,3:4)]);ip[is.na(ip$Priority),1:2,drop=FALSE]" >> docs/${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.r-version }}.md
- name: Commit config for container
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default_author: github_actions
message: "auto-update: container docs for ${{ matrix.os }}/${{ matrix.compiler }}/${{ matrix.r-version }}/abn"
add: "docs/${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.r-version }}.md"
auto-update-and-publish-tag:
runs-on: ubuntu-latest
needs: [ 'increment-tag', 'container-integrity-and-config' ]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get git-chglog and update CHANGELOG
run: |
wget ${{ env.CHGLOG_PATH }}/${{ env.CHGLOG_RELEASE}}.tar.gz # get the binary for the chglog
tar --extract --file=${{ env.CHGLOG_RELEASE}}.tar.gz git-chglog
git config user.email "[email protected]"
git config user.name "github_actions"
git tag -a ${{ steps.version.outputs.version }} -m 'interim tag for changelog'
./git-chglog -o CHANGELOG.md # update the changelog file
git tag -d ${{ steps.version.outputs.version }} # remove the tag again
- name: Commit CHANGELOG.md update
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default_author: github_actions
message: "auto-update: CHANGELOG.md"
add: 'CHANGELOG.md'
tag: "${{ needs.increment-tag.outputs.VERSION }}"