woodburn/.gitea/workflows/build.yml

35 lines
1.3 KiB
YAML
Raw Normal View History

2023-07-27 21:59:28 +10:00
name: Build Docker
run-name: Build Docker
on: [push]
jobs:
2023-07-27 22:22:22 +10:00
Build Docker:
2023-07-27 21:59:28 +10:00
runs-on: ubuntu-latest
steps:
- 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
- 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 .
docker push git.woodburn.au/nathanwoodburn/woodburn:latest
2023-07-27 21:59:28 +10:00