woodburn/.gitea/workflows/build.yml

65 lines
2.8 KiB
YAML
Raw Normal View History

2023-07-27 21:59:28 +10:00
name: Build Docker
2023-07-27 22:43:39 +10:00
run-name: Build Docker Image
2023-07-27 21:59:28 +10:00
on: [push]
jobs:
2023-07-27 22:43:39 +10:00
Build Docker:
2023-09-16 20:15:00 +10:00
runs-on: [ubuntu-latest, amd]
2023-07-27 22:48:25 +10:00
needs: CheckFiles
2023-07-27 22:43:39 +10:00
steps:
- name: Checkout
uses: actions/checkout@v2
2023-12-13 12:57:47 +11:00
- name: Fix Files
run : |
for file in *.html; do
sed -i 's/\.html//g' "$file"
done
2023-07-28 14:48:52 +10:00
- name: Install Docker
2023-07-27 21:59:28 +10:00
run : |
2023-07-27 22:26:01 +10:00
apt-get install ca-certificates curl gnupg
2023-07-27 22:29:59 +10:00
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
2023-07-27 22:26:01 +10:00
apt-get update
2023-07-27 22:30:39 +10:00
apt-get install docker-ce-cli -y
2023-07-28 14:48:52 +10:00
- name: Build Docker image
2023-09-16 20:15:00 +10:00
run : |
2023-07-27 21:59:28 +10:00
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
2023-07-28 14:33:16 +10:00
tag_num=$(git rev-parse --short HEAD)
docker build -t woodburn:$tag_num .
docker tag woodburn:$tag_num git.woodburn.au/nathanwoodburn/woodburn:$tag_num
docker push git.woodburn.au/nathanwoodburn/woodburn:$tag_num
2023-07-28 14:36:50 +10:00
docker tag woodburn:$tag_num git.woodburn.au/nathanwoodburn/woodburn:latest
docker push git.woodburn.au/nathanwoodburn/woodburn:latest
2023-09-30 12:48:54 +10:00
Build ARM Docker:
runs-on: [ubuntu-latest, arm]
needs: CheckFiles
steps:
- name: Checkout
uses: actions/checkout@v2
2023-12-13 12:57:47 +11:00
- name: Fix Files
run : |
for file in *.html; do
sed -i 's/\.html//g' "$file"
done
2023-09-30 12:48:54 +10:00
- 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 : |
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
tag_num=$(git rev-parse --short HEAD)
docker build -t woodburn:$tag_num .
docker tag woodburn:$tag_num git.woodburn.au/nathanwoodburn/woodburn:arm
docker push git.woodburn.au/nathanwoodburn/woodburn:arm
2023-07-27 21:59:28 +10:00