-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (57 loc) · 1.85 KB
/
devcontainer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build & Test Devcontainer Docker Image
on:
workflow_dispatch:
workflow_run:
workflows: "R-CMD-check"
branches: main
types: completed
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 "tag=devel" >> "$GITHUB_OUTPUT"
echo "EGGLA_VERSION=main" >> "$GITHUB_ENV"
else
echo "tag=latest,${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "EGGLA_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"
fi
- name: Build and run Dev Container on release
uses: devcontainers/[email protected]
if:
with:
subFolder: .github
imageName: ghcr.io/${{ github.repository }}
imageTag: ${{ steps.tag.outputs.tag }}
push: always
runCmd: Rscript /eggla-example.R
clean:
needs: 'build-devcontainer'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Delete obsolete/untagged versions
uses: actions/delete-package-versions@v5
with:
package-name: ${{ github.event.repository.name }}
package-type: "container"
token: ${{ secrets.GITHUB_TOKEN }}
delete-only-untagged-versions: "true"