git actions
This commit is contained in:
parent
d9d890a721
commit
911beb6720
2 changed files with 21 additions and 1 deletions
14
.github/workflows/build-test-push.yml
vendored
14
.github/workflows/build-test-push.yml
vendored
|
|
@ -64,6 +64,18 @@ jobs:
|
||||||
- name: Check out source
|
- name: Check out source
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Configure HTTP registry
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p /etc/docker
|
||||||
|
echo '{"insecure-registries":["batty1039.startdedicated.net:5000"]}' | \
|
||||||
|
sudo tee /etc/docker/daemon.json >/dev/null
|
||||||
|
sudo systemctl restart docker
|
||||||
|
cat > /tmp/buildkitd.toml <<'EOF'
|
||||||
|
[registry."batty1039.startdedicated.net:5000"]
|
||||||
|
http = true
|
||||||
|
insecure = true
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Log in to private registry
|
- name: Log in to private registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -73,6 +85,8 @@ jobs:
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
with:
|
||||||
|
buildkitd-config: /tmp/buildkitd.toml
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
|
|
|
||||||
8
Makefile
8
Makefile
|
|
@ -2,8 +2,9 @@ SHELL := /bin/sh
|
||||||
|
|
||||||
IMAGE ?= cms-demo
|
IMAGE ?= cms-demo
|
||||||
TAG ?= latest
|
TAG ?= latest
|
||||||
|
REGISTRY_IMAGE ?= batty1039.startdedicated.net:5000/cms-demo
|
||||||
|
|
||||||
.PHONY: help ui backend demo production run test check docker docker-run clean
|
.PHONY: help ui backend demo production run test check docker docker-push docker-run clean
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "make ui build the React app into cmd/server/web/dist"
|
@echo "make ui build the React app into cmd/server/web/dist"
|
||||||
|
|
@ -14,6 +15,7 @@ help:
|
||||||
@echo "make test run the Go test suite"
|
@echo "make test run the Go test suite"
|
||||||
@echo "make check gofmt, vet, and tests"
|
@echo "make check gofmt, vet, and tests"
|
||||||
@echo "make docker build the all-in-one image"
|
@echo "make docker build the all-in-one image"
|
||||||
|
@echo "make docker-push build and push the image to the private registry"
|
||||||
@echo "make docker-run run the image on :8080"
|
@echo "make docker-run run the image on :8080"
|
||||||
@echo "make clean remove build output"
|
@echo "make clean remove build output"
|
||||||
|
|
||||||
|
|
@ -51,6 +53,10 @@ check:
|
||||||
docker:
|
docker:
|
||||||
docker build -t $(IMAGE):$(TAG) .
|
docker build -t $(IMAGE):$(TAG) .
|
||||||
|
|
||||||
|
docker-push: docker
|
||||||
|
docker tag $(IMAGE):$(TAG) $(REGISTRY_IMAGE):$(TAG)
|
||||||
|
docker push $(REGISTRY_IMAGE):$(TAG)
|
||||||
|
|
||||||
docker-run:
|
docker-run:
|
||||||
docker run --rm -p 8080:8080 --env-file .env $(IMAGE):$(TAG)
|
docker run --rm -p 8080:8080 --env-file .env $(IMAGE):$(TAG)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue