Build & Test Devcontainer Docker Image #11
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 & Test Devcontainer Docker Image | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: "R-CMD-check" | |
branches: main | |
types: completed | |
release: | |
types: [published] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
build-devcontainer: | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
github.event_name == 'release' || | |
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine Tag | |
id: tag | |
run: | | |
if [ "${{ github.ref_name != 'main' }}" ]; then | |
echo ::set-output name=tag::${{ github.ref_name }} | |
else | |
echo ::set-output name=tag::devel | |
fi | |
- name: Build and run Dev Container on release | |
uses: devcontainers/[email protected] | |
if: | |
with: | |
subFolder: .github | |
imageName: ghcr.io/${{ github.repository }} | |
cacheFrom: ghcr.io/${{ github.repository }} | |
imageTag: ${{ steps.tag.outputs.tag }} | |
push: always | |
runCmd: Rscript /eggla-example.R |