Skip to content

Commit

Permalink
Add files
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli committed Sep 18, 2024
1 parent 1129823 commit c63630e
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches:
- 'main'
tags:
- 'v*'

env:
SDK_VERSION: 0.11.1

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata from Git refs and GitHub events
id: extract_metadata
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/test-image
ghcr.io/${{ github.repository_owner }}/test-image
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build machine image
uses: docker/build-push-action@v6
with:
context: .
push: true
build-args: SDK_VERSION=${{ env.SDK_VERSION }}
platforms: linux/amd64,linux/arm64
builder: ${{ steps.setup_buildx.outputs.name }}
tags: ${{ steps.extract_metadata.outputs.tags }}
labels: ${{ steps.extract_metadata.outputs.labels }}
annotations: ${{ steps.extract_metadata.outputs.annotations }}
cache-from: type=gha,scope=ubuntu
cache-to: type=gha,mode=max,scope=ubuntu
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG SDK_VERSION
FROM cryptobughunters/sdk:${SDK_VERSION}

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ***/sdk:${SDK_VERSION} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ***/sdk:${SDK_VERSION} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
set -eu
apt update
apt-get install -y --no-install-recommends \
build-essential \
git \
liblua5.4-dev \
luarocks
EOF

RUN <<EOF
set -eu
luarocks install --lua-version=5.4 cartesix
luarocks install --lua-version=5.4 lester
luarocks install --lua-version=5.4 lua-cjson
luarocks install --lua-version=5.4 luazen
EOF

0 comments on commit c63630e

Please sign in to comment.