forked from github.com/GenderDysphoria.fyi
Test new ci process...
This commit is contained in:
@@ -8,7 +8,7 @@ FROM alpine:3.17
|
|||||||
RUN apk add nginx supervisor
|
RUN apk add nginx supervisor
|
||||||
RUN mkdir -p /var/www
|
RUN mkdir -p /var/www
|
||||||
RUN rm -rf /etc/nginx
|
RUN rm -rf /etc/nginx
|
||||||
COPY /dist /var/www/build
|
COPY dist /var/www/build
|
||||||
COPY .conf/nginx /etc/nginx
|
COPY .conf/nginx /etc/nginx
|
||||||
COPY .conf/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY .conf/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
|
-
|
||||||
|
name: Checkout the docker build branch...
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ci-testing
|
||||||
|
path: /docker
|
||||||
-
|
-
|
||||||
name: Install required system packages...
|
name: Install required system packages...
|
||||||
run: |
|
run: |
|
||||||
@@ -44,37 +50,58 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Build site
|
name: Build site
|
||||||
run: npm run build
|
run: npm run build
|
||||||
-
|
|
||||||
name: Create artifact...
|
|
||||||
run: 7z a -mx=9 /artifact.7z dist
|
|
||||||
-
|
|
||||||
name: Upload artifact...
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: build_artifact
|
|
||||||
path: /artifact.7z
|
|
||||||
retention-days: 7
|
|
||||||
job2:
|
|
||||||
needs: job1
|
|
||||||
name: Build new docker container with new site build...
|
|
||||||
runs-on: catthehacker-ubuntu
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Install required system packages...
|
|
||||||
run: |
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
apt update
|
|
||||||
apt upgrade -y
|
|
||||||
apt install -y p7zip-full
|
|
||||||
-
|
|
||||||
name: Download artifact...
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: /
|
|
||||||
-
|
|
||||||
run: |
|
|
||||||
7z x /build_artifact/artifact.7z /dist; ls /dist
|
|
||||||
# -
|
# -
|
||||||
|
# name: Create artifact...
|
||||||
|
# run: 7z a -mx=9 ./artifact.7z dist
|
||||||
|
# -
|
||||||
|
# name: Upload artifact...
|
||||||
|
# uses: actions/upload-artifact@v3
|
||||||
|
# with:
|
||||||
|
# name: build_artifact
|
||||||
|
# path: dist
|
||||||
|
# retention-days: 7
|
||||||
|
-
|
||||||
|
name: Copy dist to docker...
|
||||||
|
run: cp -a dist /docker/dist
|
||||||
|
-
|
||||||
|
name: Set up docker buildx...
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Login to gitea registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.raer.me
|
||||||
|
username: ${{ secrets.PRODUCTION_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.PRODUCTION_REGISTRY_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push docker image to gitea package store
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: /docker/.docker/Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||||
|
# job2:
|
||||||
|
# needs: job1
|
||||||
|
# name: Build new docker container with new site build...
|
||||||
|
# runs-on: catthehacker-ubuntu
|
||||||
|
# steps:
|
||||||
|
# -
|
||||||
|
# name: Install required system packages...
|
||||||
|
# run: |
|
||||||
|
# export DEBIAN_FRONTEND=noninteractive
|
||||||
|
# apt update
|
||||||
|
# apt upgrade -y
|
||||||
|
# apt install -y p7zip-full
|
||||||
|
# -
|
||||||
|
# name: Download artifact...
|
||||||
|
# uses: actions/download-artifact@v3
|
||||||
|
# with:
|
||||||
|
# path: /
|
||||||
|
# -
|
||||||
|
# run: |
|
||||||
|
# 7z x /build_artifact/artifact.7z /dist; ls /dist
|
||||||
|
# # -
|
||||||
# name: Checkout the docker build branch...
|
# name: Checkout the docker build branch...
|
||||||
# uses: actions/checkout@v3
|
# uses: actions/checkout@v3
|
||||||
# with:
|
# with:
|
||||||
@@ -98,51 +125,51 @@ jobs:
|
|||||||
# platforms: linux/amd64
|
# platforms: linux/amd64
|
||||||
# tags: gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}
|
# tags: gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||||
|
|
||||||
# job2:
|
job2:
|
||||||
# needs: job1
|
needs: job1
|
||||||
# name: Connect to deployment host, update, and redeploy docs website.
|
name: Connect to deployment host, update, and redeploy docs website.
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# -
|
-
|
||||||
# name: Install required system packages...
|
name: Install required system packages...
|
||||||
# run: |
|
run: |
|
||||||
# export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
# apt update
|
apt update
|
||||||
# apt upgrade -y
|
apt upgrade -y
|
||||||
# apt install -y iputils-ping
|
apt install -y iputils-ping
|
||||||
# -
|
-
|
||||||
# name: Configure SSH...
|
name: Configure SSH...
|
||||||
# env:
|
env:
|
||||||
# SSH_USER: ${{ secrets.PRODUCTION_SSH_USER }}
|
SSH_USER: ${{ secrets.PRODUCTION_SSH_USER }}
|
||||||
# SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }}
|
SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }}
|
||||||
# SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
|
SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
|
||||||
# run: |
|
run: |
|
||||||
# mkdir -p ~/.ssh/
|
mkdir -p ~/.ssh/
|
||||||
# echo "$SSH_KEY" > ~/.ssh/staging.key
|
echo "$SSH_KEY" > ~/.ssh/staging.key
|
||||||
# chmod 600 ~/.ssh/staging.key
|
chmod 600 ~/.ssh/staging.key
|
||||||
# cat >> ~/.ssh/config <<END
|
cat >> ~/.ssh/config <<END
|
||||||
# Host staging
|
Host staging
|
||||||
# HostName $SSH_HOST
|
HostName $SSH_HOST
|
||||||
# User $SSH_USER
|
User $SSH_USER
|
||||||
# IdentityFile ~/.ssh/staging.key
|
IdentityFile ~/.ssh/staging.key
|
||||||
# StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
# END
|
END
|
||||||
# cat ~/.ssh/config
|
cat ~/.ssh/config
|
||||||
# -
|
-
|
||||||
# name: Test SSH Host...
|
name: Test SSH Host...
|
||||||
# env:
|
env:
|
||||||
# SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
|
SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
|
||||||
# run: |
|
run: |
|
||||||
# ping -c 3 $SSH_HOST
|
ping -c 3 $SSH_HOST
|
||||||
# ssh staging 'ls'
|
ssh staging 'ls'
|
||||||
# -
|
-
|
||||||
# name: Pull new image and redeploy...
|
name: Pull new image and redeploy...
|
||||||
# run: |
|
run: |
|
||||||
# ssh staging '\
|
ssh staging '\
|
||||||
# echo "${{ secrets.PRODUCTION_REGISTRY_TOKEN }}" | docker login --password-stdin --username ${{ secrets.PRODUCTION_REGISTRY_USERNAME }} gitea.raer.me; \
|
echo "${{ secrets.PRODUCTION_REGISTRY_TOKEN }}" | docker login --password-stdin --username ${{ secrets.PRODUCTION_REGISTRY_USERNAME }} gitea.raer.me; \
|
||||||
# docker stop gdb.lgbtqi.app; \
|
docker stop gdb.lgbtqi.app; \
|
||||||
# docker rm gdb.lgbtqi.app; \
|
docker rm gdb.lgbtqi.app; \
|
||||||
# docker pull gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}; \
|
docker pull gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}; \
|
||||||
# docker run -d --name gdb.lgbtqi.app -p ${{ secrets.PRODUCTION_DEPLOYMENT_HOST }}:4100:80 gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}; \
|
docker run -d --name gdb.lgbtqi.app -p ${{ secrets.PRODUCTION_DEPLOYMENT_HOST }}:4100:80 gitea.raer.me/${{ gitea.repository }}:${{ gitea.ref_name }}; \
|
||||||
# docker logout gitea.raer.me;'
|
docker logout gitea.raer.me;'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user