Skip to content

Commit

Permalink
Merge pull request #14 from increments/add-build-action
Browse files Browse the repository at this point in the history
Add workflow to build docker image to GitHub Container Registry
  • Loading branch information
tomoasleep authored Aug 29, 2023
2 parents 13d295f + cfd0c2f commit d7420f7
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build image

on:
push:
branches:
- master
tags:
- "v*"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

permissions:
contents: read
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_image:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
steps:
- uses: actions/checkout@v3
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/increments/camo
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:16.20.2

RUN apt-get update && \
apt-get -y clean && \
Expand All @@ -14,5 +14,5 @@ ADD mime-types.json /opt/camo/
EXPOSE 8081

RUN npm install
USER nobody
USER node
CMD ["npm", "start"]

0 comments on commit d7420f7

Please sign in to comment.