Skip to content

Commit 2a78a36

Browse files
committed
Update action and docs
1 parent afcdaf7 commit 2a78a36

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,41 @@
11
#
22
name: Create and publish a Docker image with tags
33

4-
# Configures this workflow to run every time a change is pushed and have tags
54
on:
65
push:
76
tags:
87
- '*'
98

10-
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
119
env:
1210
REGISTRY: ghcr.io
1311
IMAGE_NAME: ${{ github.repository }}
14-
#IMAGE_NAME: ghcr.io/justcoded/plopjs
1512

16-
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
1713
jobs:
1814
build-and-push-image:
1915
runs-on: ubuntu-latest
20-
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
2116
permissions:
2217
contents: read
2318
packages: write
24-
#
19+
2520
steps:
2621
- name: Checkout repository
2722
uses: actions/checkout@v4
28-
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
23+
2924
- name: Log in to the Container registry
30-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
25+
uses: docker/login-action@v3
3126
with:
3227
registry: ${{ env.REGISTRY }}
3328
username: ${{ github.actor }}
3429
password: ${{ secrets.GITHUB_TOKEN }}
35-
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
36-
3730

3831
- name: Extract metadata (tags, labels) for Docker
3932
id: meta
40-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33+
uses: docker/metadata-action@v5
4134
with:
4235
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4336

44-
45-
4637
- name: Set Versions
47-
uses: actions/github-script@v4
38+
uses: actions/github-script@v7
4839
id: set_version
4940
with:
5041
script: |
@@ -57,10 +48,11 @@ jobs:
5748
core.setOutput('no-dash', no_dash)
5849
5950
- name: Build and Push
60-
uses: docker/build-push-action@v2
51+
uses: docker/build-push-action@v6
6152
with:
6253
context: .
6354
push: true
6455
tags: |
6556
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
66-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{steps.set_version.outputs.no-dash}}
57+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.set_version.outputs.no-dash }}
58+

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ This project provides a **Dockerized prerender service** based on `prerender` wi
3838
```bash
3939
docker build -t prerender-service .
4040
```
41-
or check our repository
41+
or check GitHub repository
4242

4343
```
44-
path to docker image*****
44+
ghcr.io/justcoded/dockerize-prerender:latest
4545
```
4646

47+
with tag latest or number tag.
4748

4849
## 🧩 Docker Compose
4950

@@ -67,9 +68,8 @@ or
6768

6869
```
6970
services:
70-
image: prerender-image:latest
71-
ports:
72-
- "3000:3000"
71+
webapp-prerender:
72+
image: ghcr.io/justcoded/dockerize-prerender:latest
7373
shm_size: 512mb
7474
restart: unless-stopped
7575
environment:

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const prerender = require('prerender');
22
process.env.CACHE_MAXSIZE = process.env.CACHE_MAXSIZE || 1000;
3-
process.env.CACHE_TTL = process.env.CACHE_TTL || 86400;
3+
process.env.CACHE_TTL = process.env.CACHE_TTL || 43200;
44

55
const server = prerender({
66
chromeLocation: '/usr/bin/chromium',

0 commit comments

Comments
 (0)