57 lines
2.9 KiB
YAML
57 lines
2.9 KiB
YAML
name: Build Docker
|
|
run-name: Build Docker Images
|
|
on: [push]
|
|
|
|
jobs:
|
|
Build Master:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Docker
|
|
run : |
|
|
apt-get install ca-certificates curl gnupg
|
|
install -m 0755 -d /etc/apt/keyrings
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
|
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
apt-get update
|
|
apt-get install docker-ce-cli -y
|
|
- name: Build Docker image
|
|
run : |
|
|
cd master
|
|
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
|
|
tag_num=$(git rev-parse --short HEAD)
|
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
|
|
|
docker build -t hnshosting-master:$tag_num .
|
|
docker tag hnshosting-master:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master:$tag_num
|
|
docker push git.woodburn.au/nathanwoodburn/hnshosting-master:$tag_num
|
|
docker tag hnshosting-master:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-master:latest
|
|
docker push git.woodburn.au/nathanwoodburn/hnshosting-master:latest
|
|
|
|
Build Bot:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Docker
|
|
run : |
|
|
apt-get install ca-certificates curl gnupg
|
|
install -m 0755 -d /etc/apt/keyrings
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
|
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
apt-get update
|
|
apt-get install docker-ce-cli -y
|
|
- name: Build Docker image
|
|
run : |
|
|
cd discord-bot
|
|
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
|
|
tag_num=$(git rev-parse --short HEAD)
|
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
|
docker build -t hnshosting-bot:$tag_num .
|
|
docker tag hnshosting-bot:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag_num
|
|
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot:$tag_num
|
|
docker tag hnshosting-bot:$tag_num git.woodburn.au/nathanwoodburn/hnshosting-bot:latest
|
|
docker push git.woodburn.au/nathanwoodburn/hnshosting-bot:latest |