GitHub Snippets

GitHub Actions Step to check variables and redistribute as env The following step does .. check of given variables are set, if not, exit with an error that is visible in the action’s log provide the given input as environment variable in GITHUB_ENV - name: configuration env: VAR1: ${{ needs.configure.outputs.something }} VAR2: ${{ vars.SOMETHING_OTHER }}/ VAR3: "something_other_other" run: | for var in VAR1 VAR2 VAR3; do [ -n "${!var}" ] || { echo "$var is missing"; exit 1; }; echo "$var=${!var}" >> "$GITHUB_ENV"; done ...

March 1, 2010 · 1 min · 189 words · Micha Kops

GitLab Snippets

Generate AsciiDoc Documentation and Publish it with GitLab Pages We setup a repository and add a directory named docs there .. this is the home of our AsciiDoc files. We’re using asciidoctor/docker-asciidoctor as Docker image for tool provisioning This is the .gitlab-ci.yml, we’re running the stage only when something in the docs directory has changed. stages: - "Build docs" # The name of the job activates the GitLab pages publication pages: image: asciidoctor/docker-asciidoctor stage: "Build docs" tags: - build script: - sh ./gen_docs.sh - mv output public only: refs: - master changes: - /docs/* artifacts: paths: - public expose_as: 'Documentation Archive' ...

March 1, 2010 · 1 min · 186 words · Micha Kops