nginx/.gitea/workflows/release.yml

53 lines
2.6 KiB
YAML
Raw Normal View History

2023-09-11 21:46:34 +10:00
name: Build Docker for Release
run-name: Build Docker Images
on:
push:
jobs:
Build Container AMD:
runs-on: [ubuntu-latest, amd]
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 : |
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
2023-09-11 21:52:53 +10:00
tag_num=${GITHUB_RUN_NUMBER}
2023-09-11 21:54:12 +10:00
docker build -t nginx:latest .
docker tag nginx:latest git.woodburn.au/nathanwoodburn/nginx:$tag_num
2023-09-11 21:52:53 +10:00
docker push git.woodburn.au/nathanwoodburn/nginx:$tag_num
2023-09-11 21:54:12 +10:00
docker tag nginx:latest git.woodburn.au/nathanwoodburn/nginx:latest
2023-09-11 21:46:34 +10:00
docker push git.woodburn.au/nathanwoodburn/nginx:latest
Build Container ARM:
runs-on: [ubuntu-latest, arm]
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 : |
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
2023-09-11 21:52:53 +10:00
tag_num=${GITHUB_RUN_NUMBER}
2023-09-11 21:54:12 +10:00
docker build -t nginx:latest .
docker tag nginx:latest git.woodburn.au/nathanwoodburn/nginx:$tag_num-arm
2023-09-11 21:52:53 +10:00
docker push git.woodburn.au/nathanwoodburn/nginx:$tag_num-arm
2023-09-11 21:54:12 +10:00
docker tag nginx:latest git.woodburn.au/nathanwoodburn/nginx:latest-arm
2023-09-11 21:46:34 +10:00
docker push git.woodburn.au/nathanwoodburn/nginx:latest-arm