Skip to content

Commit

Permalink
Add sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
danielemery committed Feb 27, 2024
1 parent efecd0e commit 4574edd
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx:alpine

ARG APP_VERSION=NOT_CONFIGURED
ENV APP_VERSION=$APP_VERSION

COPY src/index.html /usr/share/nginx/html/index.html
RUN echo "{ \"version\": \"$APP_VERSION\" }" > /usr/share/nginx/html/info.json

EXPOSE 80
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ Proof-of-concept for a deployment/rollback flow using github actions and release
- The last release should be marked as a draft
- A deployment should be done to the `production` environment using the selected release

## Run Sample App Locally

```sh
docker build --build-arg APP_VERSION=local -t action-deployment-poc:local .
docker run -p 7890:80 action-deployment-poc:local
```
27 changes: 27 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<html>
<head>
<title>Action Deployment POC - Sample App</title>
</head>
<body>
<h1>Action Deployment POC - Sample App</h1>
<p>
This sample app has been created simply for use testing the
action-deployment-poc
</p>
<p id="version">Loading version...</p>
<script>
fetch("./info.json")
.then((response) => response.json())
.then((data) => {
document.getElementById(
"version"
).innerHTML = `Version: <strong>${data.version}</strong>`;
})
.catch((error) => {
console.error("Error:", error);
document.getElementById("version").innerHTML =
"Error loading version";
});
</script>
</body>
</html>

0 comments on commit 4574edd

Please sign in to comment.