Skip to content

Commit b125592

Browse files
authored
Use docker in GitHub actions (#34)
It's preinstalled and supported. Podman in Ubuntu is from universe.
1 parent 6a22a45 commit b125592

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

.github/workflows/prod_container_img.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ on:
2727

2828
env:
2929
IMAGE_NAME: delpa-redirection-server
30+
DOCKER_CMD: docker
3031

3132
jobs:
3233
build:
@@ -45,14 +46,11 @@ jobs:
4546
node-version: 22
4647
cache: "npm"
4748

48-
- name: Install podman
49-
run: sudo apt-get update && sudo apt-get install -y podman
50-
5149
- name: Build
5250
run: npm run build_prod
5351

5452
- name: Start the container
55-
run: podman run --detach -p 3000:80 -p 3001:443 $IMAGE_NAME
53+
run: $DOCKER_CMD run --detach -p 3000:80 -p 3001:443 $IMAGE_NAME
5654

5755
- name: Install npm dependencies
5856
run: npm ci
@@ -76,8 +74,8 @@ jobs:
7674
7775
echo IMAGE_ID=$IMAGE_ID
7876
echo VERSION=$VERSION
79-
podman tag $IMAGE_NAME $IMAGE_ID:$VERSION
80-
podman push $IMAGE_ID:$VERSION
77+
$DOCKER_CMD tag $IMAGE_NAME $IMAGE_ID:$VERSION
78+
$DOCKER_CMD push $IMAGE_ID:$VERSION
8179
8280
trigger-redeploy:
8381
name: Trigger Redeploy

.github/workflows/runtime.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
pull_request:
2424
branches: ["master"]
2525

26+
env:
27+
DOCKER_CMD: docker
28+
2629
jobs:
2730
test:
2831
name: Runtime
@@ -37,14 +40,11 @@ jobs:
3740
node-version: 22
3841
cache: "npm"
3942

40-
- name: Install podman
41-
run: sudo apt-get update && sudo apt-get install -y podman
42-
4343
- name: Build
4444
run: npm run build
4545

4646
- name: Start the container
47-
run: podman run --detach -p 3000:80 -p 3001:443 delpa-redirection-test-server
47+
run: $DOCKER_CMD run --detach -p 3000:80 -p 3001:443 delpa-redirection-test-server
4848

4949
- name: Install npm dependencies
5050
run: npm ci

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"type": "module",
99
"scripts": {
1010
"lint": "npm run compile && eslint *.ts *.mjs && prettier . --check",
11-
"build": "podman build --build-arg snapshot_versions_type=test . -t delpa-redirection-test-server",
12-
"build_prod": "podman build . -t delpa-redirection-server",
13-
"start": "podman run -it --rm -p 3000:80 -p 3001:443 --env HOST_ADDRESS delpa-redirection-test-server",
14-
"start_prod": "podman run -it --rm -p 3000:80 -p 3001:443 --env HOST_ADDRESS delpa-redirection-server",
11+
"build": "${DOCKER_CMD:-podman} build --build-arg snapshot_versions_type=test . -t delpa-redirection-test-server",
12+
"build_prod": "${DOCKER_CMD:-podman} build . -t delpa-redirection-server",
13+
"start": "${DOCKER_CMD:-podman} run -it --rm -p 3000:80 -p 3001:443 --env HOST_ADDRESS delpa-redirection-test-server",
14+
"start_prod": "${DOCKER_CMD:-podman} run -it --rm -p 3000:80 -p 3001:443 --env HOST_ADDRESS delpa-redirection-server",
1515
"test": "NODE_TLS_REJECT_UNAUTHORIZED=0 vitest --run index.test.ts",
1616
"test_prod": "NODE_TLS_REJECT_UNAUTHORIZED=0 vitest --run prod.test.ts",
1717
"format": "eslint --fix *.ts *.mjs && prettier . --write",

0 commit comments

Comments
 (0)