-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (50 loc) · 1.61 KB
/
main.yml
File metadata and controls
66 lines (50 loc) · 1.61 KB
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
65
66
name: Build & Deploy Godbolt Image
on:
workflow_dispatch:
env:
TAG: nano-2022
entry: pwsh.exe
cmd: -NoLogo -NoProfile -ExecutionPolicy Bypass
jobs:
build-and-push:
runs-on: windows-2022
outputs:
image_tagged: ${{ steps.vars.outputs.image_tagged }}
defaults:
run:
shell: pwsh
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set image tag
id: vars
run: |
$repo = $env:GITHUB_REPOSITORY.ToLower()
$imageBase = "ghcr.io/$repo"
$taggedImage = "${imageBase}:${env:TAG}"
"image_tagged=$taggedImage" >> $env:GITHUB_OUTPUT
- name: Log in to GHCR
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u $env:GITHUB_ACTOR --password-stdin
- name: Build Image
run: |
docker build `
--isolation process `
-t "${{ steps.vars.outputs.image_tagged }}" .
- name: Push Image
run: |
docker push "${{ steps.vars.outputs.image_tagged }}"
run-nano-container:
needs: build-and-push
runs-on: windows-2022
defaults:
run:
shell: pwsh
steps:
- name: Pull Image
run: docker pull "${{ needs.build-and-push.outputs.image_tagged }}"
- name: Run Container
run: docker run --entrypoint cmd --isolation process -di --name orphan "${{ needs.build-and-push.outputs.image_tagged }}" ${{ env.cmd }}
- name: Inspect Container
run: docker inspect orphan
- name: Container – Inspect Godbolt Dist
run: docker exec orphan cmd /c node --import=tsx --no-warnings=ExperimentalWarning ./app.js --version --dist