-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.DS_Store | ||
/target | ||
*.tar | ||
build/ | ||
|
||
requests.sql | ||
template-v7.db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,13 @@ jobs: | |
matrix: | ||
include: | ||
- binary: alisa | ||
arch: linux/arm64 | ||
mode: image | ||
- binary: elisa | ||
arch: linux/amd64 | ||
mode: binary | ||
- binary: elizabeth | ||
arch: linux/arm64 | ||
mode: image | ||
- binary: isabel | ||
arch: linux/amd64 | ||
mode: binary | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -32,28 +32,57 @@ jobs: | |
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
|
||
- name: Build and push image | ||
- name: Build image | ||
run: | | ||
IMAGE_ID=ghcr.io/chipp/${{ matrix.binary }} | ||
docker buildx build . --file bin/${{ matrix.binary }}/Dockerfile \ | ||
--push \ | ||
--platform ${{ matrix.arch }} \ | ||
--load \ | ||
--progress plain \ | ||
--tag $IMAGE_ID:latest \ | ||
--build-arg VERSION="0.1.${{ github.run_number }}" \ | ||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \ | ||
--cache-from=type=registry,ref=$IMAGE_ID:cache \ | ||
--cache-to=type=registry,ref=$IMAGE_ID:cache,mode=max | ||
docker ps -a | ||
- name: Compose arm64 runnable image | ||
if: matrix.mode == 'image' | ||
run: | | ||
docker ps -a | ||
docker run --rm -v "$PWD/build:/build" ghcr.io/chipp/${{ matrix.binary }}:latest \ | ||
cp /root/${{ matrix.binary }} /build/${{ matrix.binary }} | ||
docker buildx build . --file conf/arm64.Dockerfile \ | ||
--push \ | ||
--progress plain \ | ||
--tag $IMAGE_ID:latest \ | ||
--build-arg BINARY=${{ matrix.binary }} \ | ||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" | ||
- name: Extract arm64 binary | ||
if: matrix.mode == 'binary' | ||
run: | | ||
docker ps -a | ||
docker run --rm -v "$PWD/build:/build" ghcr.io/chipp/${{ matrix.binary }}:latest \ | ||
cp /root/${{ matrix.binary }} /build/${{ matrix.binary }} | ||
- name: Archive arm64 artifact | ||
if: matrix.mode == 'binary' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.binary }} | ||
path: build/${{ matrix.binary }} | ||
retention-days: 1 | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: push | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Log into registry | ||
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
|
||
- name: Add ssh key | ||
run: | | ||
mkdir ~/.ssh/ | ||
|
@@ -85,13 +114,15 @@ jobs: | |
ssh [email protected] \ | ||
"cd /web/lisa && docker compose down --remove-orphans --rmi all && docker compose up -d" | ||
- name: Extract elisa | ||
run: | | ||
docker run --rm -v "$PWD/build:/build" ghcr.io/chipp/elisa:latest cp /root/elisa /build/elisa | ||
- name: Download elisa | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: elisa | ||
|
||
- name: Extract isabel | ||
run: | | ||
docker run --rm -v "$PWD/build:/build" ghcr.io/chipp/isabel:latest cp /root/isabel /build/isabel | ||
- name: Download isabel | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: isabel | ||
|
||
- name: Deploy elisa and isabel | ||
run: | | ||
|
@@ -104,5 +135,5 @@ jobs: | |
ssh -v [email protected] "echo test" | ||
ssh [email protected] "sudo service elisa stop && sudo service isabel stop" | ||
scp build/elisa build/isabel [email protected]:/usr/local/bin | ||
scp elisa isabel [email protected]:/usr/local/bin | ||
ssh [email protected] "sudo service elisa start && sudo service isabel start" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM alpine:3.19.1 | ||
|
||
RUN apk --no-cache add ca-certificates && update-ca-certificates | ||
RUN apk --no-cache add tzdata && \ | ||
cp /usr/share/zoneinfo/Europe/Vilnius /etc/localtime && \ | ||
echo "Europe/Vilnius" > /etc/timezone && \ | ||
apk del tzdata | ||
|
||
WORKDIR /root/ | ||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt | ||
ENV SSL_CERT_DIR=/etc/ssl/certs | ||
ENV RUST_BACKTRACE=full | ||
|
||
ARG BINARY | ||
|
||
COPY build/${BINARY} . | ||
CMD [ "${BINARY}" ] |