Merge pull request #10 from pauvos/buildx

Proposal: Let's provide container images
This commit is contained in:
Metastem
2023-02-13 22:40:27 +08:00
committed by GitHub
3 changed files with 54 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
.git*
docker-compose.yml
+51
View File
@@ -0,0 +1,51 @@
name: Build docker image
on:
# Runs on pushes targeting the default branch
push:
branches: ["buildx","buildx-semver", "main"] # replace with ["main"]
tags: ['*']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Container Registry
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
flavor: |
latest=true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
+1 -2
View File
@@ -1,7 +1,6 @@
FROM node:16-alpine
RUN apk add git
RUN git clone https://github.com/Metastem/wikiless.git
WORKDIR /wikiless
COPY . /wikiless
RUN npm install --no-optional
COPY config.js.template config.js
CMD npm start