Small changes.

This commit is contained in:
Daniel 2022-06-20 20:39:41 +04:30
parent 28907bd1ee
commit 3d19c26e37
4 changed files with 3 additions and 53 deletions

View File

@ -4,3 +4,4 @@ api
.dockerignore
Dockerfile*
node_modules
storage/**

View File

@ -1,49 +0,0 @@
---
name: 'build images'
# See https://itnext.io/building-multi-cpu-architecture-docker-images-for-arm-and-x86-3-building-in-github-action-ci-a382feab5af9
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-docker-images:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Package Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build & Push Docker image for web UI
run: docker buildx build -t ghcr.io/${{ github.repository_owner }}/linkwarden:${GITHUB_SHA} -f ./Dockerfile.prod --push --platform=linux/arm64,linux/amd64 .
- name: Build & Push Docker image for API
run: docker buildx build -t ghcr.io/${{ github.repository_owner }}/linkwarden-api:${GITHUB_SHA} -f ./api/Dockerfile --push --platform=linux/arm64,linux/amd64 ./api
- name: Login to Docker Hub
env:
DH_TOKEN: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${DH_TOKEN}
- name: Re-tag & Push Docker Image to Docker Hub Web
run: |
# make config.json avaiable to regclient in docker container
chmod +r $HOME/.docker/config.json
# Run regclient in docker image
docker container run --rm --net host \
-v regctl-conf:/home/appuser/.regctl/ \
-v $HOME/.docker/config.json:/home/appuser/.docker/config.json \
regclient/regctl:v0.3.9 image copy ghcr.io/${{ github.repository_owner }}/linkwarden:${GITHUB_SHA} docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/linkwarden:latest
- name: Re-tag & Push Docker Image to Docker Hub API
run: |
# make config.json avaiable to regclient in docker container
chmod +r $HOME/.docker/config.json
# Run regclient in docker image
docker container run --rm --net host \
-v regctl-conf:/home/appuser/.regctl/ \
-v $HOME/.docker/config.json:/home/appuser/.docker/config.json \
regclient/regctl:v0.3.9 image copy ghcr.io/${{ github.repository_owner }}/linkwarden-api:${GITHUB_SHA} docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/linkwarden-api:latest

2
.gitignore vendored
View File

@ -12,7 +12,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
media
storage/**
api/.ash_history
api/.config
api/.cache/

View File

@ -13,7 +13,7 @@ services:
- MONGODB_URI=mongodb://mongo:27017/
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
volumes:
- media:/media
- ./storage:/storage
- ./api:/home/node
ports:
- 5000:5000
@ -36,5 +36,3 @@ services:
depends_on:
- link-warden-api
volumes:
media: