Skip to content

Commit b3e4ace

Browse files
committed
Adding Docker container build
1 parent 780a149 commit b3e4ace

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/container.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Docker container
2+
3+
on: [ workflow_dispatch ]
4+
5+
jobs:
6+
build_container:
7+
name: Build container
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- id: string
13+
uses: ASzc/change-string-case-action@v2
14+
with:
15+
string: ${{ github.repository_owner }}
16+
17+
- name: Build x64 binary
18+
run: mkdir build && cd build && cmake .. && cmake --build . --parallel 2 --target sqfvm
19+
env:
20+
CC: clang
21+
CXX: clang++
22+
23+
- name: Move binary to docker directory
24+
run: mv build/sqfvm docker/
25+
26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Build & push
34+
uses: docker/build-push-action@v2
35+
with:
36+
context: docker
37+
push: true
38+
tags: ghcr.io/${{ steps.string.outputs.lowercase }}/sqfvm:latest

docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ubuntu:18.04
2+
LABEL org.opencontainers.image.source=https://github.com/SQFvm/runtime
3+
WORKDIR /tmp
4+
COPY sqfvm /usr/bin/sqfvm
5+
ENTRYPOINT /usr/bin/sqfvm

0 commit comments

Comments
 (0)