woodburn/.gitea/workflows/build.yml

44 lines
1.6 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
CheckFiles:
2023-07-27 21:59:28 +10:00
runs-on: ubuntu-latest
steps:
2023-07-27 22:43:39 +10:00
- name: Commiter
run: |
echo "Commited by: ${{ gitea.actor }}!"
2023-07-27 21:59:28 +10:00
- name: Checkout
uses: actions/checkout@v2
- name: Check files
run: |
for file in *.html; do
if grep -q "$file" "$file"; then
echo "File $file contains canonical tag with .html!"
exit 1
else
echo "File $file is correct!"
fi
done
2023-07-27 22:43:39 +10:00
Build Docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2023-07-27 21:59:28 +10:00
- name: Build Docker image
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-27 21:59:28 +10:00
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
2023-07-27 22:32:08 +10:00
docker build -t woodburn:latest .
2023-07-27 22:37:26 +10:00
docker tag woodburn:latest git.woodburn.au/nathanwoodburn/woodburn:latest
2023-07-27 22:32:08 +10:00
docker push git.woodburn.au/nathanwoodburn/woodburn:latest
2023-07-27 21:59:28 +10:00