Skip to content

Commit ed9c1bf

Browse files
committed
[CI] WiP build and publish docker image
1 parent a6947da commit ed9c1bf

File tree

208 files changed

+138074
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+138074
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Docker build and publish
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
push:
10+
branches: [ deploy ]
11+
# Publish semver tags as releases.
12+
# tags: [ 'v*.*.*' ]
13+
14+
env:
15+
# Use docker.io for Docker Hub if empty
16+
REGISTRY: ghcr.io
17+
# github.repository as <account>/<repo>
18+
IMAGE_NAME: ${{ github.repository }}
19+
20+
21+
jobs:
22+
build:
23+
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
# This is used to complete the identity challenge
29+
# with sigstore/fulcio when running outside of PRs.
30+
# id-token: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
# # Install the cosign tool except on PR
37+
# # https://github.com/sigstore/cosign-installer
38+
# - name: Install cosign
39+
# if: github.event_name != 'pull_request'
40+
# uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
41+
# with:
42+
# cosign-release: 'v2.2.4'
43+
44+
# Set up BuildKit Docker container builder to be able to build
45+
# multi-platform images and export cache
46+
# https://github.com/docker/setup-buildx-action
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
49+
50+
# Login against a Docker registry except on PR
51+
# https://github.com/docker/login-action
52+
- name: Log into registry ${{ env.REGISTRY }}
53+
# if: github.event_name != 'pull_request'
54+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
55+
with:
56+
registry: ${{ env.REGISTRY }}
57+
username: ${{ github.actor }}
58+
password: ${{ secrets.GITHUB_TOKEN }}
59+
60+
# Extract metadata (tags, labels) for Docker
61+
# https://github.com/docker/metadata-action
62+
- name: Extract Docker metadata
63+
id: meta
64+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
65+
with:
66+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
67+
68+
# Build and push Docker image with Buildx
69+
# https://github.com/docker/build-push-action
70+
- name: Build and push Docker image
71+
id: build-and-push
72+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
73+
with:
74+
context: .
75+
push: ${{ github.event_name != 'pull_request' }}
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
cache-from: type=gha
79+
cache-to: type=gha,mode=max
80+
81+
# Sign the resulting Docker image digest except on PRs.
82+
# This will only write to the public Rekor transparency log when the Docker
83+
# repository is public to avoid leaking data. If you would like to publish
84+
# transparency data even for private images, pass --force to cosign below.
85+
# https://github.com/sigstore/cosign
86+
# - name: Sign the published Docker image
87+
# if: ${{ github.event_name != 'pull_request' }}
88+
# env:
89+
# # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
90+
# TAGS: ${{ steps.meta.outputs.tags }}
91+
# DIGEST: ${{ steps.build-and-push.outputs.digest }}
92+
# # This step uses the identity token to provision an ephemeral certificate
93+
# # against the sigstore community Fulcio instance.
94+
# run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

demos-docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM nginx:1.27.5-alpine-slim
2+
COPY default.conf /etc/nginx/conf.d/default.conf
3+
COPY html /usr/share/nginx/html

demos-docker/default.conf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
server {
2+
listen 80;
3+
listen [::]:80;
4+
server_name popcorn;
5+
6+
root /var/www/html;
7+
index index.html;
8+
9+
location / {
10+
add_header Cross-Origin-Opener-Policy "same-origin";
11+
add_header Cross-Origin-Embedder-Policy "require-corp";
12+
if ($request_uri ~ ^/(.*)\.html(\?|$)) {
13+
return 302 /$1$is_args$args;
14+
}
15+
try_files $uri $uri.html $uri/ =404;
16+
}
17+
18+
#access_log /var/log/nginx/host.access.log main;
19+
20+
location / {
21+
root /usr/share/nginx/html;
22+
index index.html index.htm;
23+
}
24+
25+
#error_page 404 /404.html;
26+
27+
# redirect server error pages to the static page /50x.html
28+
#
29+
error_page 500 502 503 504 /50x.html;
30+
location = /50x.html {
31+
root /usr/share/nginx/html;
32+
}
33+
34+
}
35+
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
404.html
2+
Access.html
3+
Agent.html
4+
Application.html
5+
ArgumentError.html
6+
ArithmeticError.html
7+
Atom.html
8+
BadArityError.html
9+
BadBooleanError.html
10+
BadFunctionError.html
11+
BadMapError.html
12+
BadStructError.html
13+
Base.html
14+
Behaviour.html
15+
Bitwise.html
16+
Calendar.ISO.html
17+
Calendar.TimeZoneDatabase.html
18+
Calendar.UTCOnlyTimeZoneDatabase.html
19+
Calendar.html
20+
CaseClauseError.html
21+
Code.Fragment.html
22+
Code.LoadError.html
23+
Code.html
24+
Collectable.html
25+
CompileError.html
26+
CondClauseError.html
27+
Config.Provider.html
28+
Config.Reader.html
29+
Config.html
30+
Date.Range.html
31+
Date.html
32+
DateTime.html
33+
Dict.html
34+
Duration.html
35+
DynamicSupervisor.html
36+
Enum.EmptyError.html
37+
Enum.OutOfBoundsError.html
38+
Enum.html
39+
Enumerable.html
40+
ErlangError.html
41+
Exception.html
42+
File.CopyError.html
43+
File.Error.html
44+
File.LinkError.html
45+
File.RenameError.html
46+
File.Stat.html
47+
File.Stream.html
48+
File.html
49+
Float.html
50+
Function.html
51+
FunctionClauseError.html
52+
GenEvent.html
53+
GenServer.html
54+
HashDict.html
55+
HashSet.html
56+
IO.ANSI.html
57+
IO.Stream.html
58+
IO.StreamError.html
59+
IO.html
60+
Inspect.Algebra.html
61+
Inspect.Error.html
62+
Inspect.Opts.html
63+
Inspect.html
64+
Integer.html
65+
Kernel.ParallelCompiler.html
66+
Kernel.SpecialForms.html
67+
Kernel.TypespecError.html
68+
Kernel.html
69+
KeyError.html
70+
Keyword.html
71+
List.Chars.html
72+
List.html
73+
Macro.Env.html
74+
Macro.html
75+
Map.html
76+
MapSet.html
77+
MatchError.html
78+
MismatchedDelimiterError.html
79+
Module.html
80+
NaiveDateTime.html
81+
Node.html
82+
OptionParser.ParseError.html
83+
OptionParser.html
84+
PartitionSupervisor.html
85+
Path.html
86+
Port.html
87+
Process.html
88+
Protocol.UndefinedError.html
89+
Protocol.html
90+
Range.html
91+
Record.html
92+
Regex.CompileError.html
93+
Regex.html
94+
Registry.html
95+
RuntimeError.html
96+
Set.html
97+
Stream.html
98+
String.Chars.html
99+
String.html
100+
StringIO.html
101+
Supervisor.Spec.html
102+
Supervisor.html
103+
SyntaxError.html
104+
System.EnvError.html
105+
System.html
106+
SystemLimitError.html
107+
Task.Supervisor.html
108+
Task.html
109+
Time.html
110+
TokenMissingError.html
111+
TryClauseError.html
112+
Tuple.html
113+
URI.Error.html
114+
URI.html
115+
UndefinedFunctionError.html
116+
UnicodeConversionError.html
117+
Version.InvalidRequirementError.html
118+
Version.InvalidVersionError.html
119+
Version.Requirement.html
120+
Version.html
121+
WithClauseError.html
122+
agents.html
123+
alias-require-and-import.html
124+
anonymous-functions.html
125+
api-reference.html
126+
assets
127+
assets/kv-observer.png
128+
assets/logo.png
129+
assets/logo.png
130+
basic-types.html
131+
binaries-strings-and-charlists.html
132+
case-cond-and-if.html
133+
changelog.html
134+
code-anti-patterns.html
135+
compatibility-and-deprecations.html
136+
comprehensions.html
137+
config-and-releases.html
138+
debugging.html
139+
dependencies-and-umbrella-projects.html
140+
design-anti-patterns.html
141+
dist/AtomVM.js
142+
dist/AtomVM.wasm
143+
dist/eval.avm
144+
dist/html-KNMUZUZQ.js
145+
dist/html-elixir-PD7PAHEK.css
146+
dist/lato-latin-400-normal-W7754I4D.woff2
147+
dist/lato-latin-700-normal-2XVSBPG4.woff2
148+
dist/lato-latin-ext-400-normal-N27NCBWW.woff2
149+
dist/lato-latin-ext-700-normal-Q2L5DVMW.woff2
150+
dist/remixicon-NKANDIL5.woff2
151+
dist/search_data-EB331F8B.js
152+
dist/sidebar_items-3D721A5F.js
153+
distributed-tasks.html
154+
docs-tests-and-with.html
155+
domain-specific-languages.html
156+
dynamic-supervisor.html
157+
enum-cheat.html
158+
enumerable-and-streams.html
159+
erlang-libraries.html
160+
erlang-term-storage.html
161+
genservers.html
162+
gradual-set-theoretic-types.html
163+
index.html
164+
introduction-to-mix.html
165+
introduction.html
166+
io-and-the-file-system.html
167+
keywords-and-maps.html
168+
library-guidelines.html
169+
lists-and-tuples.html
170+
macro-anti-patterns.html
171+
macros.html
172+
module-attributes.html
173+
modules-and-functions.html
174+
naming-conventions.html
175+
operators.html
176+
optional-syntax.html
177+
pattern-matching.html
178+
patterns-and-guards.html
179+
process-anti-patterns.html
180+
processes.html
181+
protocols.html
182+
quote-and-unquote.html
183+
recursion.html
184+
search.html
185+
sigils.html
186+
structs.html
187+
supervisor-and-application.html
188+
syntax-reference.html
189+
task-and-gen-tcp.html
190+
try-catch-and-rescue.html
191+
typespecs.html
192+
unicode-syntax.html
193+
what-anti-patterns.html
194+
writing-documentation.html

0 commit comments

Comments
 (0)